[wp-trac] [WordPress Trac] #59847: Since WordPress 6.4, the functions.php of a theme moved to a different location using register_theme_directory is no longer called

WordPress Trac noreply at wordpress.org
Wed Nov 8 22:36:46 UTC 2023


#59847: Since WordPress 6.4, the functions.php of a theme moved to a different
location using register_theme_directory is no longer called
-----------------------------+------------------------------------
 Reporter:  partyfrikadelle  |       Owner:  joemcgill
     Type:  defect (bug)     |      Status:  reviewing
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Bootstrap/Load   |     Version:  6.4
 Severity:  critical         |  Resolution:
 Keywords:                   |     Focuses:  template, performance
-----------------------------+------------------------------------

Comment (by joemcgill):

 Replying to [comment:13 coreyw]:
 > @joemcgill It doesn't appear that resetting the globals would help. It
 seems that calls to `get_stylesheet_directory()` return an invalid path if
 called before a certain point (when the theme is setup perhaps).

 Interesting. Perhaps the answer would be to make sure we don't memoize
 these paths until the `plugins_loaded` or `setup_theme` action has fired,
 to ensure that early calls to those functions don't result in stale
 values?

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


More information about the wp-trac mailing list