On this page
wp_scripts(): WP_Scripts
Initialize $wp_scripts if it has not been set.
Return
WP_Scripts WP_Scripts instance.
Source
File: wp-includes/functions.wp-scripts.php. View all references
function wp_scripts() {
global $wp_scripts;
if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
$wp_scripts = new WP_Scripts();
}
return $wp_scripts;
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Scripts::__construct() wp-includes/class-wp-scripts.php | Constructor. |
Used By
| Used By | Description |
|---|---|
| _wp_get_iframed_editor_assets() wp-includes/block-editor.php | Collect the block editor assets that need to be loaded into the editor’s iframe. |
| _WP_Editors::force_uncompressed_tinymce() wp-includes/class-wp-editor.php | Force uncompressed TinyMCE when a custom theme has been defined. |
| load_script_textdomain() wp-includes/l10n.php | Loads the script translated strings. |
| wp_add_inline_script() wp-includes/functions.wp-scripts.php | Adds extra code to a registered script. |
| WP_Customize_Nav_Menus::enqueue_scripts() wp-includes/class-wp-customize-nav-menus.php | Enqueues scripts and styles for Customizer pane. |
| wp_script_add_data() wp-includes/functions.wp-scripts.php | Add metadata to a script. |
| _wp_customize_loader_settings() wp-includes/theme.php | Adds settings for the customize-loader script. |
| wp_print_scripts() wp-includes/functions.wp-scripts.php | Prints scripts in document head that are in the $handles queue. |
| wp_register_script() wp-includes/functions.wp-scripts.php | Register a new script. |
| wp_deregister_script() wp-includes/functions.wp-scripts.php | Remove a registered script. |
| wp_enqueue_script() wp-includes/functions.wp-scripts.php | Enqueue a script. |
| wp_dequeue_script() wp-includes/functions.wp-scripts.php | Remove a previously enqueued script. |
| wp_script_is() wp-includes/functions.wp-scripts.php | Determines whether a script has been added to the queue. |
| wp_plupload_default_settings() wp-includes/media.php | Prints default Plupload arguments. |
| print_head_scripts() wp-includes/script-loader.php | Prints the script queue in the HTML head on admin pages. |
Changelog
| Version | Description |
|---|---|
| 4.2.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_scripts