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

function wp_scripts() {
	global $wp_scripts;

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

	return $wp_scripts;
}

Changelog

Version Description
4.2.0 Introduced.

© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_scripts