[wp-trac] [WordPress Trac] #57547: Remove get_default_block_editor_settings from theme JSON resolver

WordPress Trac noreply at wordpress.org
Thu Jan 26 18:38:02 UTC 2023


#57547: Remove get_default_block_editor_settings from theme JSON resolver
-------------------------------------------------+-------------------------
 Reporter:  Mamaduka                             |       Owner:  flixos90
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.2
Component:  Themes                               |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests gutenberg-  |     Focuses:
  merge                                          |  performance
-------------------------------------------------+-------------------------
Changes (by flixos90):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"55146" 55146]:
 {{{
 #!CommitTicketReference repository="" revision="55146"
 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.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57547#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list