[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
Sun Jan 22 12:10:54 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:77 oandregal]:
 > @otto42 Note how using the static cache leaks into the API via parameter
 to clean it upon certain events:
 >
 > {{{#!php
 > <?php
 > wp_theme_has_theme_json( $can_use_cache = true ) {
 > }}}

 A static variable doesn't persist between runs. You don't need an extra
 parameter to clear it.

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


More information about the wp-trac mailing list