Fix logic inversion in [28124] to ensure widgets stay with themes during a theme switch.

Merges [28161] to the 3.9 branch.

props gcorne.
fixes #27897.

Built from https://develop.svn.wordpress.org/branches/3.9@28162


git-svn-id: http://core.svn.wordpress.org/branches/3.9@27993 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-04-19 18:14:16 +00:00
parent 0cecdccf75
commit 3dd112ef79
1 changed files with 2 additions and 2 deletions

View File

@ -1421,7 +1421,7 @@ function retrieve_widgets( $theme_changed = false ) {
// time() that sidebars were stored is in $old_sidebars_widgets['time'] // time() that sidebars were stored is in $old_sidebars_widgets['time']
$_sidebars_widgets = $old_sidebars_widgets['data']; $_sidebars_widgets = $old_sidebars_widgets['data'];
if ( 'customize' === $theme_changed ) { if ( 'customize' !== $theme_changed ) {
remove_theme_mod( 'sidebars_widgets' ); remove_theme_mod( 'sidebars_widgets' );
} }
@ -1506,7 +1506,7 @@ function retrieve_widgets( $theme_changed = false ) {
} }
$sidebars_widgets['wp_inactive_widgets'] = array_merge($lost_widgets, (array) $sidebars_widgets['wp_inactive_widgets']); $sidebars_widgets['wp_inactive_widgets'] = array_merge($lost_widgets, (array) $sidebars_widgets['wp_inactive_widgets']);
if ( 'customize' === $theme_changed ) { if ( 'customize' !== $theme_changed ) {
wp_set_sidebars_widgets( $sidebars_widgets ); wp_set_sidebars_widgets( $sidebars_widgets );
} }