mirror of
git://develop.git.wordpress.org/
synced 2025-02-27 18:13:00 +01:00
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
This commit is contained in:
parent
9a484c5f35
commit
746cb153c1
@ -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 );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user