[wp-trac] [WordPress Trac] #57928: Prevent loading wp-content/themes/functions.php when 'stylesheet' option is empty

WordPress Trac noreply at wordpress.org
Wed Mar 15 14:07:58 UTC 2023


#57928: Prevent loading wp-content/themes/functions.php when 'stylesheet' option is
empty
--------------------------------------------+------------------------------
 Reporter:  danielbachhuber                 |       Owner:  (none)
     Type:  enhancement                     |      Status:  new
 Priority:  normal                          |   Milestone:  Awaiting Review
Component:  Bootstrap/Load                  |     Version:
 Severity:  normal                          |  Resolution:
 Keywords:  dev-feedback reporter-feedback  |     Focuses:
--------------------------------------------+------------------------------

Comment (by hellofromTonya):

 In that line of thinking:

 What if there is a real-world use case for `WP_CONTENT_DIR .
 '/themes/functions.php'` to exist? If there is, then returning empty
 strings from `wp_get_active_and_valid_themes()` would break loading that
 file on those sites.

 What are the other impacts of real-world usages of invoking
 ``wp_get_active_and_valid_themes()` when `get_stylesheet()` and/or
 `get_template()` return an empty string?

 Is `wp_get_active_and_valid_themes()` intentionally designed to allow only
 pointing at the main themes directory (root)? Or is this an oversight? hmm

 I'm curious of the potential BC breaks of such a change.

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


More information about the wp-trac mailing list