[wp-trac] [WordPress Trac] #56975: Replace the internal `WP_Theme_JSON_Resolver::theme_has_support()` with a public function

WordPress Trac noreply at wordpress.org
Wed Jan 18 18:51:14 UTC 2023


#56975: Replace the internal `WP_Theme_JSON_Resolver::theme_has_support()` with a
public function
-------------------------------------------------+-------------------------
 Reporter:  oandregal                            |       Owner:
                                                 |  hellofromTonya
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.2
Component:  Themes                               |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests commit      |     Focuses:
  dev-feedback                                   |  performance
-------------------------------------------------+-------------------------
Changes (by costdev):

 * keywords:  has-patch has-unit-tests commit => has-patch has-unit-tests
     commit dev-feedback


Comment:

 `wp_cache_get()` is defined either in `wp-includes/cache.php`, or in an
 external object cache. `wp_start_object_cache()` determines which of these
 should be loaded.

 This is called in two places: `wp-settings.php`, and `wp-includes/ms-
 settings.php`.

 For `wp-includes/global-styles-and-settings.php`, this is loaded in:
 - `wp-settings.php` which, as mentioned above, already calls
 `wp_start_object_cache()`, so this is safe.
 - `wp-admin/load-styles.php`, which **doesn't** load `wp-
 includes/load.php` and call `wp_start_object_cache()`.

 @Otto42 has confirmed to me that `wp-admin/load-styles.php` was in the
 stacktrace, so it seems that we need to load `wp-includes/load.php` and
 call `wp_start_object_cache()` in `wp-admin/load-styles.php`.

 Thoughts?

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


More information about the wp-trac mailing list