-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return empty array when not using themes #4409
Return empty array when not using themes #4409
Conversation
fd7a76d
to
1553607
Compare
Seems like a hacky test failure... |
@@ -948,6 +948,10 @@ function wp_get_active_and_valid_themes() { | |||
return $themes; | |||
} | |||
|
|||
if ( ! wp_using_themes() ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielbachhuber Would STYLESHEETPATH
be empty in this context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spacedmonkey Unfortunately not. It's set to an erroneous value:
diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php
index 9780519856..bc0a35ab0e 100644
--- a/src/wp-includes/load.php
+++ b/src/wp-includes/load.php
@@ -948,6 +948,9 @@ function wp_get_active_and_valid_themes() {
return $themes;
}
+ var_dump( 'TEMPLATEPATH: ' . TEMPLATEPATH );
+ var_dump( 'STYLESHEETPATH: ' . STYLESHEETPATH );
+
if ( ! wp_using_themes() ) {
return $themes;
}
$ wp --skip-themes option get home
string(82) "TEMPLATEPATH: /Users/danielbachhuber/projects/wordpress-develop/wp-content/themes/"
string(84) "STYLESHEETPATH: /Users/danielbachhuber/projects/wordpress-develop/wp-content/themes/"
https://wordpress-develop.test
Notice the value is /wordpress-develop/wp-content/themes/
without a theme slug.
Some unit tests for this would be useful to understand what this change means. |
1553607
to
11384bf
Compare
Added a test case in 35091f8
wordpress-develop/src/wp-settings.php Lines 587 to 593 in 35091f8
Interestingly, the random test failures in my first commit were caused by
|
Shipped with https://core.trac.wordpress.org/changeset/55890 |
Returns an empty array from
wp_get_active_and_valid_themes()
when! wp_using_themes()
. The empty array preventswp-content/themes/functions.php
from being loaded erroneously.See https://core.trac.wordpress.org/ticket/57928