[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 19:35: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:  (none)
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Bootstrap/Load   |    Version:  6.4
 Severity:  critical         |   Keywords:
  Focuses:  template         |
-----------------------------+-----------------------------
 We operate a WordPress Multisite instance with a quite specific setup.
 Part of our setup is that we do not store the themes we developed in the
 normal wp-content/themes folder, but in a special folder of a plugin. We
 register this folder with register_theme_directory so that the themes are
 recognized by WordPress.

 Unfortunately, this no longer works since the update to 6.4. I have
 noticed that the functions get_stylesheet_directory() and
 get_template_directory() produce different results depending on when they
 are called in the process.

 If I call both functions in the index.php of the theme, the correct paths
 to the moved themes are outputted. However, if I call the two functions in
 the function wp_get_active_and_valid_themes() in /wp-includes/load.php,
 incorrect paths to the standard theme directory are generated, which do
 not exist. As a result, the functions.php of the parent theme and child
 theme are not found and the files are not included.

 I am still trying to figure out exactly what is causing this and would
 provide a patch if I should find a solution before others.

 Best regards!

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


More information about the wp-trac mailing list