From 0c23ef3cf075d90c2557147ca7f544e30212b3af Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sun, 11 Nov 2012 21:51:27 +0000 Subject: [PATCH] In switch_theme(), make sure there are no residual template_root or stylesheet_root options remaining if there is only one theme root registered. see #22252. git-svn-id: https://develop.svn.wordpress.org/trunk@22545 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/theme.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index e9dca021ff..3d5cb70512 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -682,6 +682,9 @@ function switch_theme( $stylesheet ) { if ( count( $wp_theme_directories ) > 1 ) { update_option( 'template_root', get_raw_theme_root( $template, true ) ); update_option( 'stylesheet_root', get_raw_theme_root( $stylesheet, true ) ); + } else { + delete_option( 'template_root' ); + delete_option( 'stylesheet_root' ); } $new_name = $new_theme->get('Name');