wp_script_is( string $handle, string $list = 'enqueued' )

Check whether a script has been added to the queue.


Parameters

$handle

(string) (Required) Name of the script.

$list

(string) (Optional) Status of the script to check. Accepts 'enqueued', 'registered', 'queue', 'to_do', and 'done'.

Default value: 'enqueued'


Return

(bool) Whether the script is queued.


Source

File: wp-includes/functions.wp-scripts.php

function wp_script_is( $handle, $list = 'enqueued' ) {
	_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );

	return (bool) wp_scripts()->query( $handle, $list );
}


Changelog

Changelog
Version Description
WP-3.5.0 'enqueued' added as an alias of the 'queue' list.
WP-2.8.0 Introduced.