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.

Built from https://develop.svn.wordpress.org/trunk@55146


git-svn-id: http://core.svn.wordpress.org/trunk@54679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Felix Arntz
2023-01-26 18:39:13 +00:00
parent 89706afd21
commit cbb418fbe2
3 changed files with 42 additions and 23 deletions

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.2-alpha-55145';
$wp_version = '6.2-alpha-55146';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.