Global Styles: Improve performance of WP_Theme_JSON::get_merged_data method.
In the WordPress 6.1 cycle, WP_Theme_JSON_Resolver::get_merged_data method has become a hot path that is called many times. By improving small things that are repeated multiple times, we get more performance wins. This commit reduces the number of calls of the low-level WP_Theme_JSON->merge method, with the corresponding performance improvements. Props oandregal, aristath, mukeshpanchal27. See #56467. Built from https://develop.svn.wordpress.org/trunk@54517 git-svn-id: http://core.svn.wordpress.org/trunk@54072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
11ca0151d4
commit
1ea37c466d
|
@ -548,8 +548,7 @@ class WP_Theme_JSON_Resolver {
|
||||||
_deprecated_argument( __FUNCTION__, '5.9.0' );
|
_deprecated_argument( __FUNCTION__, '5.9.0' );
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = new WP_Theme_JSON();
|
$result = static::get_core_data();
|
||||||
$result->merge( static::get_core_data() );
|
|
||||||
$result->merge( static::get_block_data() );
|
$result->merge( static::get_block_data() );
|
||||||
$result->merge( static::get_theme_data() );
|
$result->merge( static::get_theme_data() );
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.1-RC1-54511';
|
$wp_version = '6.1-RC1-54517';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
|
|
Loading…
Reference in New Issue