Make WordPress Core


Ignore:
Timestamp:
10/11/2022 08:06:16 PM (2 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/tests/phpunit/tests/theme/wpThemeJsonResolver.php

    r54493 r54501  
    391391        }
    392392
    393         $expected_filter_count = did_filter( 'theme_json_default' );
     393        $expected_filter_count = did_filter( 'wp_theme_json_data_default' );
    394394        $actual                = WP_Theme_JSON_Resolver::get_core_data();
    395395        if ( $should_fire_filter ) {
     
    397397        }
    398398
    399         $this->assertSame( $expected_filter_count, did_filter( 'theme_json_default' ), 'The filter "theme_json_default" should fire the given number of times' );
     399        $this->assertSame( $expected_filter_count, did_filter( 'wp_theme_json_data_default' ), 'The filter "theme_json_default" should fire the given number of times' );
    400400        $this->assertInstanceOf( WP_Theme_JSON::class, $actual, 'WP_Theme_JSON_Resolver::get_core_data() should return instance of WP_Theme_JSON' );
    401401        $this->assertSame( static::$property_core->getValue(), $actual, 'WP_Theme_JSON_Resolver::$core property should be the same object as returned from WP_Theme_JSON_Resolver::get_core_data()' );
Note: See TracChangeset for help on using the changeset viewer.