Use theme mods instead of transients for storing the previous theme's widgets config, props aaroncampbell, see #17979

git-svn-id: https://develop.svn.wordpress.org/trunk@18654 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2011-09-08 19:25:20 +00:00
parent 048c04c07c
commit 808ea899ad
2 changed files with 10 additions and 8 deletions

View File

@@ -1246,7 +1246,11 @@ function preview_theme_ob_filter_callback( $matches ) {
* @param string $stylesheet Stylesheet name.
*/
function switch_theme($template, $stylesheet) {
global $wp_theme_directories;
global $wp_theme_directories, $sidebars_widgets;
if ( ! is_array( $sidebars_widgets ) )
$sidebars_widgets = wp_get_sidebars_widgets();
set_theme_mod( 'sidebars_widgets', array( 'time' => time(), 'data' => $sidebars_widgets ) );
$old_theme = get_current_theme();