On this page
wp_script_is( string $handle, string $list = 'enqueued' ): bool
Determines whether a script has been added to the queue.
Description
For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.
Parameters
$handlestring Required-
Name of the script.
$liststring Optional-
Status of the script to check. Default
'enqueued'.
Accepts'enqueued','registered','queue','to_do', and'done'.Default:
'enqueued'
Return
bool Whether the script is queued.
Source
File: wp-includes/functions.wp-scripts.php. View all references
function wp_script_is( $handle, $list = 'enqueued' ) {
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );
return (bool) wp_scripts()->query( $handle, $list );
}
Related
Uses
| Uses | Description |
|---|---|
| wp_scripts() wp-includes/functions.wp-scripts.php | Initialize $wp_scripts if it has not been set. |
Used By
| Used By | Description |
|---|---|
| the_block_editor_meta_boxes() wp-admin/includes/post.php | Renders the meta boxes forms. |
| wp_localize_community_events() wp-includes/script-loader.php | Localizes community events data that needs to be passed to dashboard.js. |
| wp_localize_jquery_ui_datepicker() wp-includes/script-loader.php | Localizes the jQuery UI datepicker. |
Changelog
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_script_is