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.
Built from https://develop.svn.wordpress.org/trunk@54501


git-svn-id: http://core.svn.wordpress.org/trunk@54060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya 2022-10-11 20:08:12 +00:00
parent 3c1fb44650
commit 88cee0d359
4 changed files with 8 additions and 8 deletions

View File

@ -180,7 +180,7 @@ class WP_Theme_JSON_Resolver {
* *
* @param WP_Theme_JSON_Data Class to access and update the underlying data. * @param WP_Theme_JSON_Data Class to access and update the underlying data.
*/ */
$theme_json = apply_filters( 'theme_json_default', new WP_Theme_JSON_Data( $config, 'default' ) ); $theme_json = apply_filters( 'wp_theme_json_data_default', new WP_Theme_JSON_Data( $config, 'default' ) );
$config = $theme_json->get_data(); $config = $theme_json->get_data();
static::$core = new WP_Theme_JSON( $config, 'default' ); static::$core = new WP_Theme_JSON( $config, 'default' );
@ -256,7 +256,7 @@ class WP_Theme_JSON_Resolver {
* *
* @param WP_Theme_JSON_Data Class to access and update the underlying data. * @param WP_Theme_JSON_Data Class to access and update the underlying data.
*/ */
$theme_json = apply_filters( 'theme_json_theme', new WP_Theme_JSON_Data( $theme_json_data, 'theme' ) ); $theme_json = apply_filters( 'wp_theme_json_data_theme', new WP_Theme_JSON_Data( $theme_json_data, 'theme' ) );
$theme_json_data = $theme_json->get_data(); $theme_json_data = $theme_json->get_data();
static::$theme = new WP_Theme_JSON( $theme_json_data ); static::$theme = new WP_Theme_JSON( $theme_json_data );
} }
@ -357,7 +357,7 @@ class WP_Theme_JSON_Resolver {
* *
* @param WP_Theme_JSON_Data Class to access and update the underlying data. * @param WP_Theme_JSON_Data Class to access and update the underlying data.
*/ */
$theme_json = apply_filters( 'theme_json_blocks', new WP_Theme_JSON_Data( $config, 'blocks' ) ); $theme_json = apply_filters( 'wp_theme_json_data_blocks', new WP_Theme_JSON_Data( $config, 'blocks' ) );
$config = $theme_json->get_data(); $config = $theme_json->get_data();
static::$blocks = new WP_Theme_JSON( $config, 'blocks' ); static::$blocks = new WP_Theme_JSON( $config, 'blocks' );
@ -490,7 +490,7 @@ class WP_Theme_JSON_Resolver {
* *
* @param WP_Theme_JSON_Data Class to access and update the underlying data. * @param WP_Theme_JSON_Data Class to access and update the underlying data.
*/ */
$theme_json = apply_filters( 'theme_json_user', new WP_Theme_JSON_Data( $config, 'custom' ) ); $theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data( $config, 'custom' ) );
$config = $theme_json->get_data(); $config = $theme_json->get_data();
return new WP_Theme_JSON( $config, 'custom' ); return new WP_Theme_JSON( $config, 'custom' );
} }
@ -508,7 +508,7 @@ class WP_Theme_JSON_Resolver {
} }
/** This filter is documented in wp-includes/class-wp-theme-json-resolver.php */ /** This filter is documented in wp-includes/class-wp-theme-json-resolver.php */
$theme_json = apply_filters( 'theme_json_user', new WP_Theme_JSON_Data( $config, 'custom' ) ); $theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data( $config, 'custom' ) );
$config = $theme_json->get_data(); $config = $theme_json->get_data();
static::$user = new WP_Theme_JSON( $config, 'custom' ); static::$user = new WP_Theme_JSON( $config, 'custom' );

View File

@ -1911,7 +1911,7 @@ class WP_Theme_JSON {
* *
* @param array $nodes Style nodes with metadata. * @param array $nodes Style nodes with metadata.
*/ */
return apply_filters( 'theme_json_get_style_nodes', $nodes ); return apply_filters( 'wp_theme_json_get_style_nodes', $nodes );
} }
/** /**

View File

@ -2429,7 +2429,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. * This removes the CSS from the global-styles stylesheet and adds it to the inline CSS for each block.
* This filter must be registered before calling wp_get_global_stylesheet(); * This filter must be registered before calling wp_get_global_stylesheet();
*/ */
add_filter( 'theme_json_get_style_nodes', 'wp_filter_out_block_nodes' ); add_filter( 'wp_theme_json_get_style_nodes', 'wp_filter_out_block_nodes' );
$stylesheet = wp_get_global_stylesheet(); $stylesheet = wp_get_global_stylesheet();

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.1-beta3-54500'; $wp_version = '6.1-beta3-54501';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.