From f81deab03658f5fa5e7e8776410877ab06f57c97 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 19 Apr 2014 18:12:15 +0000 Subject: [PATCH] Fix logic inversion in [28124] to ensure widgets stay with themes during a theme switch. fixes #27897. Built from https://develop.svn.wordpress.org/trunk@28161 git-svn-id: http://core.svn.wordpress.org/trunk@27992 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/widgets.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 4905bbdb07..97c875e7c8 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -1421,7 +1421,7 @@ function retrieve_widgets( $theme_changed = false ) { // time() that sidebars were stored is in $old_sidebars_widgets['time'] $_sidebars_widgets = $old_sidebars_widgets['data']; - if ( 'customize' === $theme_changed ) { + if ( 'customize' !== $theme_changed ) { 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']); - if ( 'customize' === $theme_changed ) { + if ( 'customize' !== $theme_changed ) { wp_set_sidebars_widgets( $sidebars_widgets ); }