From 3fb4889b1fffd307b04d00c404e61a9316d7d32d Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Wed, 7 Jun 2023 20:27:17 +0000 Subject: [PATCH] Bootstrap/Load: Revert [55890]. As it turns out, WP-CLI *also* doesn't `define( 'WP_USE_THEMES', true );`, which means an active theme's `functions.php` isn't loaded by default and causes a backwards compatibility break. See #57928. git-svn-id: https://develop.svn.wordpress.org/trunk@55891 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/load.php | 4 --- tests/phpunit/includes/bootstrap.php | 1 - .../tests/load/wpGetActiveAndValidThemes.php | 30 ------------------- 3 files changed, 35 deletions(-) delete mode 100644 tests/phpunit/tests/load/wpGetActiveAndValidThemes.php diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php index 9780519856..02bf0299bf 100644 --- a/src/wp-includes/load.php +++ b/src/wp-includes/load.php @@ -948,10 +948,6 @@ function wp_get_active_and_valid_themes() { return $themes; } - if ( ! wp_using_themes() ) { - return $themes; - } - if ( TEMPLATEPATH !== STYLESHEETPATH ) { $themes[] = STYLESHEETPATH; } diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php index 7e183c995d..1113a87eea 100644 --- a/tests/phpunit/includes/bootstrap.php +++ b/tests/phpunit/includes/bootstrap.php @@ -252,7 +252,6 @@ $phpmailer = new MockPHPMailer( true ); if ( ! defined( 'WP_DEFAULT_THEME' ) ) { define( 'WP_DEFAULT_THEME', 'default' ); } -define( 'WP_USE_THEMES', true ); $wp_theme_directories = array(); if ( file_exists( DIR_TESTDATA . '/themedir1' ) ) { diff --git a/tests/phpunit/tests/load/wpGetActiveAndValidThemes.php b/tests/phpunit/tests/load/wpGetActiveAndValidThemes.php deleted file mode 100644 index f6519486f8..0000000000 --- a/tests/phpunit/tests/load/wpGetActiveAndValidThemes.php +++ /dev/null @@ -1,30 +0,0 @@ -assertEquals( - array( - TEMPLATEPATH, - ), - wp_get_active_and_valid_themes() - ); - - // Disabling 'wp_using_themes' should return an empty array. - add_filter( 'wp_using_themes', '__return_false' ); - $this->assertEquals( - array(), - wp_get_active_and_valid_themes() - ); - } -}