Make WordPress Core


Ignore:
Timestamp:
10/11/2022 08:06:16 PM (4 years ago)
Author:
hellofromTonya
Message:

Editor: Rename new theme_json_{$context} filters.

The newly introduced filters are renamed to use the wp_theme_json_data{$context} structure:

  • theme_json_default renamed to wp_theme_json_data_default
  • theme_json_theme renamed to wp_theme_json_data_theme
  • theme_json_blocks renamed to wp_theme_json_data_blocks
  • theme_json_user renamed to wp_theme_json_data_user

The following new filter gets the wp_ prefix added:

  • theme_json_get_style_nodes renamed to wp_theme_json_get_style_nodes

Follow-up to [56467], [54183], [54118].

Props kebbet, desrosj, mukesh27, ocean90, sergeybiryukov, davidbaumwald, hellofromTonya.
Fixes #56796.

File:
1 edited

Legend:

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

    r54493 r54501  
    181181                 * @param WP_Theme_JSON_Data Class to access and update the underlying data.
    182182                 */
    183                 $theme_json   = apply_filters( 'theme_json_default', new WP_Theme_JSON_Data( $config, 'default' ) );
     183                $theme_json   = apply_filters( 'wp_theme_json_data_default', new WP_Theme_JSON_Data( $config, 'default' ) );
    184184                $config       = $theme_json->get_data();
    185185                static::$core = new WP_Theme_JSON( $config, 'default' );
    … …  
    257257                         * @param WP_Theme_JSON_Data Class to access and update the underlying data.
    258258                         */
    259                         $theme_json      = apply_filters( 'theme_json_theme', new WP_Theme_JSON_Data( $theme_json_data, 'theme' ) );
     259                        $theme_json      = apply_filters( 'wp_theme_json_data_theme', new WP_Theme_JSON_Data( $theme_json_data, 'theme' ) );
    260260                        $theme_json_data = $theme_json->get_data();
    261261                        static::$theme   = new WP_Theme_JSON( $theme_json_data );
    … …  
    358358                 * @param WP_Theme_JSON_Data Class to access and update the underlying data.
    359359                 */
    360                 $theme_json = apply_filters( 'theme_json_blocks', new WP_Theme_JSON_Data( $config, 'blocks' ) );
     360                $theme_json = apply_filters( 'wp_theme_json_data_blocks', new WP_Theme_JSON_Data( $config, 'blocks' ) );
    361361                $config     = $theme_json->get_data();
    362362
    … …  
    491491                                 * @param WP_Theme_JSON_Data Class to access and update the underlying data.
    492492                                 */
    493                                 $theme_json = apply_filters( 'theme_json_user', new WP_Theme_JSON_Data( $config, 'custom' ) );
     493                                $theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data( $config, 'custom' ) );
    494494                                $config     = $theme_json->get_data();
    495495                                return new WP_Theme_JSON( $config, 'custom' );
    … …  
    509509
    510510                /** This filter is documented in wp-includes/class-wp-theme-json-resolver.php */
    511                 $theme_json   = apply_filters( 'theme_json_user', new WP_Theme_JSON_Data( $config, 'custom' ) );
     511                $theme_json   = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data( $config, 'custom' ) );
    512512                $config       = $theme_json->get_data();
    513513                static::$user = new WP_Theme_JSON( $config, 'custom' );
Note: See TracChangeset for help on using the changeset viewer.