Skip to content

Commit

Permalink
Always return a WP_Theme object from wp_get_theme(). If we can't find…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
nacin committed Apr 19, 2012
1 parent 53e6ba7 commit abd8d6a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions wp-includes/theme.php
Expand Up @@ -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;
}

Expand Down

0 comments on commit abd8d6a

Please sign in to comment.