wp_deregister_script (line 80)
Remove a registered script.
void
wp_deregister_script
( $handle)
wp_enqueue_script (line 96)
Enqueues script.
Registers the script if src provided (does NOT overwrite) and enqueues.
void
wp_enqueue_script
( $handle, [ $src = false], [ $deps = array()], [ $ver = false], [ $in_footer = false])
-
$handle
-
$src
-
$deps
-
$ver
-
$in_footer
wp_localize_script (line 66)
Localizes a script.
Localizes only if script has already been added.
void
wp_localize_script
( $handle, $object_name, $l10n)
-
$handle
-
$object_name
-
$l10n
wp_print_scripts (line 21)
Prints script tags in document head.
Called by admin-header.php and by wp_head hook. Since it is called by wp_head on every page load, the function does not instantiate the WP_Scripts object unless script names are explicitly passed. Does make use of already instantiated $wp_scripts if present. Use provided wp_print_scripts hook to register/enqueue new scripts.
void
wp_print_scripts
([ $handles = false])
wp_register_script (line 48)
Register new JavaScript file.
null
wp_register_script
(string $handle, string $src, [array $deps = array()], [string|bool $ver = false], [bool $in_footer = false])
-
string
$handle: Script name
-
string
$src: Script url
-
array
$deps: (optional) Array of script names on which this script depends
-
string|bool
$ver: (optional) Script version (used for cache busting), set to NULL to disable
-
bool
$in_footer: (optional) Wether to enqueue the script before </head> or before </body>
wp_script_is (line 122)
Check whether script has been added to WordPress Scripts.
The values for list defaults to 'queue', which is the same as enqueue for scripts.
bool
wp_script_is
(string $handle, [string $list = 'queue'])
-
string
$handle: Handle used to add script.
-
string
$list: Optional, defaults to 'queue'. Others values are 'registered', 'queue', 'done', 'to_do'