From a653754287d7dda0f13d2a89780dd58438d230aa Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 15 Dec 2010 17:39:00 +0000 Subject: [PATCH] Add theme_mods option if is_admin. props MarkJaquith, fixes #14828. git-svn-id: https://develop.svn.wordpress.org/trunk@16958 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/theme.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 41cdac17e4..70039a0704 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -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); }