Skip to content

Commit

Permalink
Add prefix theme_json_ in hooks related to theme.json (#44189)
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal authored and ockham committed Sep 19, 2022
1 parent 4431560 commit ac50ea8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/compat/wordpress-6.1/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,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 ) ) {
Expand Down

0 comments on commit ac50ea8

Please sign in to comment.