mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Themes: Avoid unnecessary database queries from get_default_block_editor_settings() in WP_Theme_JSON_Resolver::get_theme_data().
The `get_default_block_editor_settings()` function included several pieces of data that are irrelevant for the purpose that `WP_Theme_JSON_Resolver` was calling it for, yet resulted in three database queries on page load that can be avoided. This changeset introduces a new function `get_classic_theme_supports_block_editor_settings()` to takes responsibility of only the data needed in `WP_Theme_JSON_Resolver`, which now uses that function. This leads to a reduction of database queries and accordingly a performance improvement. Props mamaduka, spacedmonkey, oandregal, flixos90, audrasjb, mukesh27. Fixes #57547. git-svn-id: https://develop.svn.wordpress.org/trunk@55146 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -286,7 +286,7 @@ class WP_Theme_JSON_Resolver {
|
||||
* So we take theme supports, transform it to theme.json shape
|
||||
* and merge the static::$theme upon that.
|
||||
*/
|
||||
$theme_support_data = WP_Theme_JSON::get_from_editor_settings( get_default_block_editor_settings() );
|
||||
$theme_support_data = WP_Theme_JSON::get_from_editor_settings( get_classic_theme_supports_block_editor_settings() );
|
||||
if ( ! wp_theme_has_theme_json() ) {
|
||||
if ( ! isset( $theme_support_data['settings']['color'] ) ) {
|
||||
$theme_support_data['settings']['color'] = array();
|
||||
|
||||
Reference in New Issue
Block a user