wp_script_modules(): WP_Script_Modules

In this article

Retrieves the main WP_Script_Modules instance.

Description

This function provides access to the WP_Script_Modules instance, creating one if it doesn’t exist yet.

Return

WP_Script_Modules The main WP_Script_Modules instance.

Source

function wp_script_modules(): WP_Script_Modules {
	global $wp_script_modules;

	if ( ! ( $wp_script_modules instanceof WP_Script_Modules ) ) {
		$wp_script_modules = new WP_Script_Modules();
	}

	return $wp_script_modules;
}

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.