wp_deregister_script
wp_deregister_style
wp_enqueue_script
wp_enqueue_style
wp_localize_script
wp_print_scripts
wp_print_styles
wp_register_script
wp_register_style
wp_script_is
wp_style_is
wp_deregister_script($handle)
wp_deregister_style(string $handle)
| package | BackPress |
|---|---|
| since | r79 |
| see | For additional information. |
| global | object $wp_styles The WP_Styles object for printing styles. |
stringName of the stylesheet.
wp_enqueue_script($handle, $src= false, $deps= array(), $ver= false, $in_footer= false)
Registers the script if src provided (does NOT overwrite) and enqueues.
| package | BackPress |
|---|---|
| since | r16 |
| see | For parameter information. |
wp_enqueue_style(string $handle, string|boolean $src= false, array $deps= array(), string|boolean $ver= false, string $media= false)
Registers the style if src provided (does NOT overwrite) and enqueues.
| package | BackPress |
|---|---|
| since | r79 |
| see | WP_Styles::enqueue() |
| global | object $wp_styles The WP_Styles object for printing styles. |
| link | List of CSS media types. |
stringName of the stylesheet.
stringbooleanPath to the stylesheet from the root directory of WordPress. Example: '/css/mystyle.css'.
arrayArray of handles (names) of any stylesheet that this stylesheet depends on. (Stylesheets that must be loaded before this stylesheet.) Pass an empty array if there are no dependencies.
stringbooleanString specifying the stylesheet version number, if it has one. This parameter is used to ensure that the correct version is sent to the client regardless of caching, and so should be included if a version number is available and makes sense for the stylesheet.
stringThe media for which this stylesheet has been defined.
wp_localize_script($handle, $object_name, $l10n)
Localizes only if script has already been added.
| package | BackPress |
|---|---|
| since | r16 |
| see |
wp_print_scripts($handles = false)
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.
| package | BackPress |
|---|---|
| since | r16 |
| see |
wp_print_styles(array|boolean $handles = false) : boolean
| package | BackPress |
|---|---|
| since | r79 |
| uses | Calls 'wp_print_styles' hook. |
| global | object $wp_styles The WP_Styles object for printing styles. |
arraybooleanStyles to be printed. An empty array prints the queue, an array with one string prints that style, and an array of strings prints those styles.
booleanTrue on success, false on failure.wp_register_script(string $handle, string $src, array $deps= array(), string|boolean $ver= false, boolean $in_footer= false) : null
| package | BackPress |
|---|---|
| since | r16 |
stringScript name
stringScript url
array(optional) Array of script names on which this script depends
stringboolean(optional) Script version (used for cache busting), set to NULL to disable
boolean(optional) Wether to enqueue the script before or before
nullwp_register_style(string $handle, string|boolean $src, array $deps= array(), string|boolean $ver= false, string $media= 'all')
| package | BackPress |
|---|---|
| since | r79 |
| see | For additional information. |
| global | object $wp_styles The WP_Styles object for printing styles. |
| link | List of CSS media types. |
stringName of the stylesheet.
stringbooleanPath to the stylesheet from the root directory of WordPress. Example: '/css/mystyle.css'.
arrayArray of handles of any stylesheet that this stylesheet depends on. (Stylesheets that must be loaded before this stylesheet.) Pass an empty array if there are no dependencies.
stringbooleanString specifying the stylesheet version number. Set to NULL to disable. Used to ensure that the correct version is sent to the client regardless of caching.
stringThe media for which this stylesheet has been defined.
wp_script_is(string $handle, string $list = 'queue') : boolean
The values for list defaults to 'queue', which is the same as enqueue for scripts.
| package | BackPress |
|---|---|
| since | WP unknown; BP unknown |
stringHandle used to add script.
stringOptional, defaults to 'queue'. Others values are 'registered', 'queue', 'done', 'to_do'
booleanwp_style_is(string $handle, string $list = 'queue') : boolean
The values for list defaults to 'queue', which is the same as wp_enqueue_style().
| package | BackPress |
|---|---|
| since | WP unknown; BP unknown |
| global | object $wp_styles The WP_Styles object for printing styles. |
stringName of the stylesheet.
stringValues are 'registered', 'done', 'queue' and 'to_do'.
booleanTrue on success, false on failure.