[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:27:13 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:80 oandregal]:
 > > A static variable doesn't persist between runs. You don't need an
 extra parameter to clear it.
 >
 > What if the variable is initialized before a "change of theme" such as
 the `switch_theme` or `start_previewing_theme` hook? An easy way to see
 how it fails is by removing the last commit or the parameter in the PR and
 observing the dozens of PHP unit tests failures.

 I would say to change the run ordering so that it happens after those
 theme hooks. Why would it run before those hooks if you're changing the
 theme? Do you need to know of the theme.json files existence on a theme
 you're switching away from?

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


More information about the wp-trac mailing list