Script Loader: Use a global variable in wp_script_modules().

This brings the function more in line with its related `wp_scripts()` and `wp_styles()` functions and makes it easier to reset the class instance in tests.

Props westonruter, luisherranz.
See #56313.

git-svn-id: https://develop.svn.wordpress.org/trunk@57503 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Pascal Birchler
2024-01-31 18:14:30 +00:00
parent 6dd00b1ffa
commit 03cb3e30f2
2 changed files with 10 additions and 5 deletions

View File

@@ -378,6 +378,8 @@ require ABSPATH . WPINC . '/class-wp-script-modules.php';
require ABSPATH . WPINC . '/script-modules.php';
require ABSPATH . WPINC . '/interactivity-api.php';
wp_script_modules()->add_hooks();
$GLOBALS['wp_embed'] = new WP_Embed();
/**