From 68cb29c4657f4e79583a7bcc575e6e39510aa740 Mon Sep 17 00:00:00 2001 From: Douglas Date: Wed, 18 Feb 2026 19:59:24 -0300 Subject: [PATCH 1/2] add guard to script modules registration removal if Gutenberg is not activated --- .../wp-build/templates/module-registration.php.template | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/wp-build/templates/module-registration.php.template b/packages/wp-build/templates/module-registration.php.template index 888bfcef13ff25..aa7ec1fd5d1a75 100644 --- a/packages/wp-build/templates/module-registration.php.template +++ b/packages/wp-build/templates/module-registration.php.template @@ -42,5 +42,9 @@ if ( ! function_exists( '{{PREFIX}}_register_script_modules' ) ) { } add_action( 'wp_default_scripts', '{{PREFIX}}_register_script_modules' ); - remove_action( 'wp_default_scripts', 'wp_default_script_modules' ); + + if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { + // Remove Core's default script modules registration so Gutenberg can replace them with its own. + remove_action( 'wp_default_scripts', 'wp_default_script_modules' ); + } } From c6c82ff4167c9073a8d0e62af19620690e754c8b Mon Sep 17 00:00:00 2001 From: Douglas Date: Thu, 19 Feb 2026 13:56:05 -0300 Subject: [PATCH 2/2] delete script module registration removal entirely --- packages/wp-build/templates/module-registration.php.template | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/wp-build/templates/module-registration.php.template b/packages/wp-build/templates/module-registration.php.template index aa7ec1fd5d1a75..a531d8e2ca3bf5 100644 --- a/packages/wp-build/templates/module-registration.php.template +++ b/packages/wp-build/templates/module-registration.php.template @@ -42,9 +42,4 @@ if ( ! function_exists( '{{PREFIX}}_register_script_modules' ) ) { } add_action( 'wp_default_scripts', '{{PREFIX}}_register_script_modules' ); - - if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { - // Remove Core's default script modules registration so Gutenberg can replace them with its own. - remove_action( 'wp_default_scripts', 'wp_default_script_modules' ); - } }