From 746cb153c172cf1e30e9e5e6555aef68d9b6f0fd Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 8 Mar 2012 21:22:24 +0000 Subject: [PATCH] Store stylesheet rather than theme name in the theme_switched option. see #20103. git-svn-id: https://develop.svn.wordpress.org/trunk@20163 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/theme.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 8044101e89..65da096c04 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -746,7 +746,7 @@ function switch_theme( $template, $stylesheet ) { add_option( "theme_mods_$stylesheet", $default_theme_mods ); } - update_option( 'theme_switched', $old_theme->get('Name') ); + update_option( 'theme_switched', $old_theme->get_stylesheet() ); do_action( 'switch_theme', $new_name, $new_theme ); } @@ -1564,8 +1564,9 @@ add_action( 'delete_attachment', '_delete_attachment_theme_mod' ); * @since 3.3.0 */ function check_theme_switched() { - if ( false !== ( $old_theme = get_option( 'theme_switched' ) ) && !empty( $old_theme ) ) { - do_action( 'after_switch_theme', $old_theme ); + if ( $stylesheet = get_option( 'theme_switched' ) ) { + $old_theme = wp_get_theme( $stylesheet ); + do_action( 'after_switch_theme', $old_theme->get('Name'), $old_theme ); update_option( 'theme_switched', false ); } }