Make WordPress Core

Changeset 54183


Ignore:
Timestamp:
09/15/2022 08:26:13 PM (2 years ago)
Author:
SergeyBiryukov
Message:

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:

Reference: #3247 Add hooks to filter theme.json data.

Follow-up to [54118].

Props oandregal, scruffian, bernhard-reiter.
See #56467.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme-json.php

    r54162 r54183  
    18741874         * @param array $nodes Style nodes with metadata.
    18751875         */
    1876         return apply_filters( 'get_style_nodes', $nodes );
     1876        return apply_filters( 'theme_json_get_style_nodes', $nodes );
    18771877    }
    18781878
  • trunk/src/wp-includes/script-loader.php

    r54182 r54183  
    24142414     */
    24152415    if ( $separate_assets ) {
    2416         add_filter( 'get_style_nodes', 'wp_filter_out_block_nodes' );
     2416        add_filter( 'theme_json_get_style_nodes', 'wp_filter_out_block_nodes' );
    24172417        // Add each block as an inline css.
    24182418        wp_add_global_styles_for_blocks();
Note: See TracChangeset for help on using the changeset viewer.