Make WordPress Core


Ignore:
Timestamp:
06/07/2023 08:08:00 PM (20 months ago)
Author:
danielbachhuber
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/load.php

    r55680 r55890  
    949949    }
    950950
     951    if ( ! wp_using_themes() ) {
     952        return $themes;
     953    }
     954
    951955    if ( TEMPLATEPATH !== STYLESHEETPATH ) {
    952956        $themes[] = STYLESHEETPATH;
Note: See TracChangeset for help on using the changeset viewer.