Add theme_mods option if is_admin. props MarkJaquith, fixes #14828.

git-svn-id: http://svn.automattic.com/wordpress/trunk@16958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-12-15 17:39:00 +00:00
parent ff9a04a8ea
commit 4cc8f440e4
1 changed files with 4 additions and 0 deletions

View File

@ -1256,6 +1256,10 @@ function switch_theme($template, $stylesheet) {
}
delete_option('current_theme');
$theme = get_current_theme();
if ( is_admin() && false === get_option( "theme_mods_$stylesheet" ) ) {
$default_theme_mods = (array) get_option( "mods_$theme" );
add_option( "theme_mods_$stylesheet", $default_theme_mods );
}
do_action('switch_theme', $theme);
}