From 1953f53b0118d37d8e3207ea665fcdb86aaf8630 Mon Sep 17 00:00:00 2001 From: gziolo Date: Fri, 10 May 2024 09:09:17 +0000 Subject: [PATCH] Script Modules: Hooks are not registered in wp-admin Script Modules cannot be used in wp-admin. The necessary hooks are registered on wp_head or wp_footer, but should also be registered for the admin variants so that modules can be used from wp-admin. Fixes #61086. Props jonsurrell, cbravobernal, gziolo. Built from https://develop.svn.wordpress.org/trunk@58126 git-svn-id: http://core.svn.wordpress.org/trunk@57591 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-script-modules.php | 4 ++++ wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-script-modules.php b/wp-includes/class-wp-script-modules.php index d391878d7c..b7e843e307 100644 --- a/wp-includes/class-wp-script-modules.php +++ b/wp-includes/class-wp-script-modules.php @@ -178,6 +178,10 @@ class WP_Script_Modules { add_action( $position, array( $this, 'print_import_map' ) ); add_action( $position, array( $this, 'print_enqueued_script_modules' ) ); add_action( $position, array( $this, 'print_script_module_preloads' ) ); + + add_action( 'admin_print_footer_scripts', array( $this, 'print_import_map' ) ); + add_action( 'admin_print_footer_scripts', array( $this, 'print_enqueued_script_modules' ) ); + add_action( 'admin_print_footer_scripts', array( $this, 'print_script_module_preloads' ) ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 0dbfda1589..028e6f1d15 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-alpha-58125'; +$wp_version = '6.6-alpha-58126'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.