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: http://svn.automattic.com/wordpress/trunk@20524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2012-04-19 03:33:42 +00:00
parent 53e6ba7959
commit abd8d6a4c2
1 changed files with 2 additions and 3 deletions

View File

@ -98,9 +98,8 @@ function wp_get_theme( $stylesheet = null, $theme_root = null ) {
if ( empty( $theme_root ) ) { if ( empty( $theme_root ) ) {
$theme_root = get_raw_theme_root( $stylesheet ); $theme_root = get_raw_theme_root( $stylesheet );
if ( false === $theme_root ) if ( false === $theme_root )
return false; $theme_root = WP_CONTENT_DIR . $theme_root;
elseif ( ! in_array( $theme_root, (array) $wp_theme_directories ) )
if ( ! in_array( $theme_root, (array) $wp_theme_directories ) )
$theme_root = WP_CONTENT_DIR . $theme_root; $theme_root = WP_CONTENT_DIR . $theme_root;
} }