Always return a WP_Theme object from wp_get_theme(). If we can't find the theme root, assume the default theme root. (Which will probably result in a WP_Theme object that returns false for the exists() method, which is fine.) see #20361.
git-svn-id: https://develop.svn.wordpress.org/trunk@20524 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e8a29e70d6
commit
66bea4d318
|
@ -98,9 +98,8 @@ function wp_get_theme( $stylesheet = null, $theme_root = null ) {
|
|||
if ( empty( $theme_root ) ) {
|
||||
$theme_root = get_raw_theme_root( $stylesheet );
|
||||
if ( false === $theme_root )
|
||||
return false;
|
||||
|
||||
if ( ! in_array( $theme_root, (array) $wp_theme_directories ) )
|
||||
$theme_root = WP_CONTENT_DIR . $theme_root;
|
||||
elseif ( ! in_array( $theme_root, (array) $wp_theme_directories ) )
|
||||
$theme_root = WP_CONTENT_DIR . $theme_root;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue