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:
parent
ff9a04a8ea
commit
4cc8f440e4
|
@ -1256,6 +1256,10 @@ function switch_theme($template, $stylesheet) {
|
||||||
}
|
}
|
||||||
delete_option('current_theme');
|
delete_option('current_theme');
|
||||||
$theme = get_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);
|
do_action('switch_theme', $theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue