[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
Fri Jan 20 10:31:11 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:  dev-feedback gutenberg-merge has-    |     Focuses:
  patch has-unit-tests has-testing-info          |  performance
-------------------------------------------------+-------------------------

Comment (by Otto42):

 Replying to [comment:69 oandregal]:
 > > I will try getting numbers for the static variable cache on my
 analysis as well, since that looks quite promising in yours.
 >
 > Yeah, though, I wouldn't recommend going back to that point. The fact
 that it leaks into the API (parameter in the function to clean the cache)
 is not great. The performance improvement is negligible compared to other
 much bigger impact we can have with changes in other areas (upcoming PRs,
 etc.).

 Can you please explain what "leaks into the API" means?

 Also, for static variable, you wouldn't need any function to clean the
 cache. In fact, you seem to have  gone to so much effort to make it a non-
 persistent cache that you shouldn't need to clean it at all in the first
 place.

 And the use of a static variable for such a thing is quite likely to be
 much, much faster than using the wp_cache functions.

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


More information about the wp-trac mailing list