Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp script is


Determine if a script has been registered, enqueued, printed, or is waiting to be printed. Very useful when registering/enqueing scripts in plugins to avoid conflicts with other plugin scripts.


<?php wp_script_is$handle$list 'enqueued' ); ?>


(string) (required) Name of the script. Lowercase string.
Default: None
(string) (optional) The list to query.
  • registered - script was registered through wp_register_script()
  • enqueued / queue - script was enqueued
  • done - script has been printed
  • to_do - script has not yet been printed
Default: enqueued

Return Values

True or false.


   $handle = 'fluidVids.js';
   $list = 'enqueued';
     if (wp_script_is( $handle, $list )) {
     } else {
       wp_register_script( 'fluidVids.js', plugin_dir_url(__FILE__).'js/fluidvids.min.js');
       wp_enqueue_script( 'fluidVids.js' );

This would check if the script named 'fluidVids.js' is enqueued. If it is enqueued, it does nothing. If it is not enqueued, the files are then registered and enqueued.

Change Log

Source File

wp_script_is() is located in wp-includes/functions.wp-scripts.php.


Enqueue Styles

Enqueue Scripts

Front-End Hooks

Admin Hooks

Login Hooks

See also index of Function Reference and index of Template Tags.