[wp-trac] [WordPress Trac] #57814: Use `wp_theme_has_theme_json` in `_wp_theme_json_webfonts_handler`

WordPress Trac noreply at wordpress.org
Sat Mar 11 00:01:32 UTC 2023


#57814: Use `wp_theme_has_theme_json` in `_wp_theme_json_webfonts_handler`
---------------------------+------------------------------
 Reporter:  spacedmonkey   |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Script Loader  |     Version:  6.0
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:  performance
---------------------------+------------------------------

Comment (by spacedmonkey):

 The expensive part of `_wp_theme_json_webfonts_handler`, is the call to
 `WP_Theme_JSON_Resolver::get_merged_data()`. If this is not called here,
 is called later in `wp_get_global_settings` / `wp_enqueue_global_styles`.
 If we can workout caching, `wp_get_global_settings` persistently then that
 could solve this problem. We are just moving that piece of heavy compute
 later in the process of the page.

 I will see what I can do.

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


More information about the wp-trac mailing list