Skip to content

Commit

Permalink
Editor: Finalize the theme_json_get_style_nodes hook name.
Browse files Browse the repository at this point in the history
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:
* [WordPress/gutenberg#44189 #44189 Use prefix 'theme_json_' in hooks related to theme.json]

Reference: [WordPress/wordpress-develop#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: https://core.svn.wordpress.org/trunk@53742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
SergeyBiryukov committed Sep 15, 2022
1 parent d90fba0 commit 91ea1bc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion wp-includes/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -1873,7 +1873,7 @@ protected static function get_style_nodes( $theme_json, $selectors = array() ) {
*
* @param array $nodes Style nodes with metadata.
*/
return apply_filters( 'get_style_nodes', $nodes );
return apply_filters( 'theme_json_get_style_nodes', $nodes );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 91ea1bc

Please sign in to comment.