wp_scripts() WordPress Function

The wp_scripts() function is used to load and enqueue scripts for your Wordpress site. This function is typically called in the header or footer of your site.

wp_scripts() #

Initialize $wp_scripts if it has not been set.


Return

(WP_Scripts) WP_Scripts instance.


Top ↑

Source

File: wp-includes/functions.wp-scripts.php

function wp_scripts() {
	global $wp_scripts;

	if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
		$wp_scripts = new WP_Scripts();
	}

	return $wp_scripts;
}


Top ↑

Changelog

Changelog
VersionDescription
4.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.