/*
* Since retrieve_widgets() is called when initializing a theme in the Customizer,
* we need to remove the theme mods to avoid overwriting changes made via
* the Customizer when accessing wp-admin/widgets.php.
*/
if ( 'wp_ajax_customize_save' ===
current_action() ) { remove_theme_mod( 'sidebars_widgets'
);
} } // Stores classic sidebars for later use by block themes.
if ( $new_theme->
is_block_theme() ) { set_theme_mod( 'wp_classic_sidebars',
$wp_registered_sidebars );
} update_option( 'theme_switched',
$old_theme->
get_stylesheet() );
/**
* Fires after the theme is switched.
*
* See {@see 'after_switch_theme'}.
*
* @since 1.5.0
* @since 4.5.0 Introduced the `$old_theme` parameter.
*
* @param string $new_name Name of the new theme.
* @param WP_Theme $new_theme WP_Theme instance of the new theme.
* @param WP_Theme $old_theme WP_Theme instance of the old theme.
*/