Widgets: Revert format of sidebars_widgets.

Restores the data format of the `sidebars_widgets` theme mod to its pre [41555]
format. It can trigger PHP warnings after switching themes if that mod has not
been removed previously.

Fixes #39693.


Built from https://develop.svn.wordpress.org/trunk@41673


git-svn-id: http://core.svn.wordpress.org/trunk@41507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Konstantin Obenland 2017-10-02 18:11:46 +00:00
parent 6db8e66b43
commit 1e6810e433
3 changed files with 3 additions and 2 deletions

View File

@ -690,7 +690,7 @@ function switch_theme( $stylesheet ) {
}
if ( is_array( $_sidebars_widgets ) ) {
set_theme_mod( 'sidebars_widgets', $_sidebars_widgets );
set_theme_mod( 'sidebars_widgets', array( 'time' => time(), 'data' => $_sidebars_widgets ) );
}
$nav_menu_locations = get_theme_mod( 'nav_menu_locations' );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-alpha-41672';
$wp_version = '4.9-alpha-41673';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -1286,6 +1286,7 @@ function wp_map_sidebars_widgets( $existing_sidebars_widgets ) {
// Sidebars_widgets settings from when this theme was previously active.
$old_sidebars_widgets = get_theme_mod( 'sidebars_widgets' );
$old_sidebars_widgets = $old_sidebars_widgets['data'];
if ( is_array( $old_sidebars_widgets ) ) {