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

WordPress Trac noreply at wordpress.org
Wed Jun 7 20:08:16 UTC 2023


#57928: Prevent loading wp-content/themes/functions.php when 'stylesheet' option is
empty
------------------------------------+------------------------------
 Reporter:  danielbachhuber         |       Owner:  danielbachhuber
     Type:  enhancement             |      Status:  closed
 Priority:  normal                  |   Milestone:  6.3
Component:  Bootstrap/Load          |     Version:
 Severity:  normal                  |  Resolution:  fixed
 Keywords:  dev-feedback has-patch  |     Focuses:
------------------------------------+------------------------------
Changes (by danielbachhuber):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"55890" 55890]:
 {{{
 #!CommitTicketReference repository="" revision="55890"
 Load: Avoid loading a theme's `functions.php` when `! wp_using_themes()`.

 Updates `wp_get_active_and_valid_themes()` to return early when
 `wp_using_themes()` returns `false`. This prevents a theme's
 `functions.php` from being loaded erroneously when the site isn't using
 themes.

 Also adds `define( 'WP_USE_THEMES', true );` to the test suite bootstrap.
 Some tests randomly break without it because they were dependent on the
 previous buggy behavior.

 Props bpayton, costdev, danielbachhuber, hellofromtonya, sergeybiryukov,
 spacedmonkey.
 Fixes #57928.
 }}}

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


More information about the wp-trac mailing list