From 335203e9719b167bb3eb8b7cf5bfa30d24276e67 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 15 Sep 2022 20:28:18 +0000 Subject: [PATCH] Editor: Finalize the `theme_json_get_style_nodes` hook name. This consolidates the name of a filter introduced earlier in the 6.1 cycle, renaming it from `get_style_nodes` to `theme_json_get_style_nodes` as to be more coherent with the other hooks introduced in 6.1 as well. This commit backports the original PR from Gutenberg repository: * [https://github.com/WordPress/gutenberg/pull/44189 #44189 Use prefix 'theme_json_' in hooks related to theme.json] Reference: [https://github.com/WordPress/wordpress-develop/pull/3247 #3247 Add hooks to filter theme.json data]. Follow-up to [54118]. Props oandregal, scruffian, bernhard-reiter. See #56467. Built from https://develop.svn.wordpress.org/trunk@54183 git-svn-id: http://core.svn.wordpress.org/trunk@53742 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-theme-json.php | 2 +- wp-includes/script-loader.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp-theme-json.php b/wp-includes/class-wp-theme-json.php index 4e7c704cce..bfb659d2ed 100644 --- a/wp-includes/class-wp-theme-json.php +++ b/wp-includes/class-wp-theme-json.php @@ -1873,7 +1873,7 @@ class WP_Theme_JSON { * * @param array $nodes Style nodes with metadata. */ - return apply_filters( 'get_style_nodes', $nodes ); + return apply_filters( 'theme_json_get_style_nodes', $nodes ); } /** diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 4ba0d2101a..c2fa897e29 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -2413,7 +2413,7 @@ function wp_enqueue_global_styles() { * This removes the CSS from the global-styles stylesheet and adds it to the inline CSS for each block. */ if ( $separate_assets ) { - add_filter( 'get_style_nodes', 'wp_filter_out_block_nodes' ); + add_filter( 'theme_json_get_style_nodes', 'wp_filter_out_block_nodes' ); // Add each block as an inline css. wp_add_global_styles_for_blocks(); } diff --git a/wp-includes/version.php b/wp-includes/version.php index c7aa2e9d4f..4ac654459d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-54182'; +$wp_version = '6.1-alpha-54183'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.