From 48e841b70a08d77a4ea550c0d4314c3eb4418fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Thu, 15 Sep 2022 15:33:15 +0200 Subject: [PATCH] Add prefix `theme_json_` in hooks related to `theme.json` (#44189) --- lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php | 2 +- lib/compat/wordpress-6.1/script-loader.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php b/lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php index 0ec0256c834699..31ce6d6964b55f 100644 --- a/lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php +++ b/lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php @@ -534,7 +534,7 @@ protected static function get_style_nodes( $theme_json, $selectors = array() ) { $nodes = array_merge( $nodes, static::get_block_nodes( $theme_json, $selectors ) ); // This filter allows us to modify the output of WP_Theme_JSON so that we can do things like loading block CSS independently. - return apply_filters( 'gutenberg_get_style_nodes', $nodes ); + return apply_filters( 'gutenberg_theme_json_get_style_nodes', $nodes ); } /** diff --git a/lib/compat/wordpress-6.1/script-loader.php b/lib/compat/wordpress-6.1/script-loader.php index ba3d2c11c876ef..e32b72f0ce664c 100644 --- a/lib/compat/wordpress-6.1/script-loader.php +++ b/lib/compat/wordpress-6.1/script-loader.php @@ -144,7 +144,7 @@ function gutenberg_enqueue_global_styles() { * This removes the CSS from the global-styles stylesheet and adds it to the inline CSS for each block. * This filter has to be registered before we call gutenberg_get_global_stylesheet(); */ - add_filter( 'gutenberg_get_style_nodes', 'gutenberg_filter_out_block_nodes', 10, 1 ); + add_filter( 'gutenberg_theme_json_get_style_nodes', 'gutenberg_filter_out_block_nodes', 10, 1 ); $stylesheet = gutenberg_get_global_stylesheet(); if ( empty( $stylesheet ) ) {