From abd8d6a4c20bf7febc6b76cc95ea1ae0292c28bc Mon Sep 17 00:00:00 2001 From: nacin Date: Thu, 19 Apr 2012 03:33:42 +0000 Subject: [PATCH] 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 --- wp-includes/theme.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 92c0f99b00d4..c01c9a07fd4b 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -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; }