diff --git src/wp-includes/class-wp-customize-widgets.php src/wp-includes/class-wp-customize-widgets.php
index 5b3e702..52d174f 100644
|
|
final class WP_Customize_Widgets { |
1064 | 1064 | * @return array |
1065 | 1065 | */ |
1066 | 1066 | public function preview_sidebars_widgets( $sidebars_widgets ) { |
1067 | | $sidebars_widgets = get_option( 'sidebars_widgets' ); |
| 1067 | $sidebars_widgets = get_option( 'sidebars_widgets', array() ); |
1068 | 1068 | |
1069 | 1069 | unset( $sidebars_widgets['array_version'] ); |
1070 | 1070 | return $sidebars_widgets; |
diff --git tests/phpunit/tests/customize/widgets.php tests/phpunit/tests/customize/widgets.php
index 721f804..c0836d3 100644
|
|
class Tests_WP_Customize_Widgets extends WP_UnitTestCase { |
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
| 102 | * Test registering sidebars without an extant sidebars_widgets option. |
| 103 | * |
| 104 | * @see WP_Customize_Widgets::customize_register() |
| 105 | * @see WP_Customize_Widgets::preview_sidebars_widgets() |
| 106 | * @ticket 36660 |
| 107 | */ |
| 108 | function test_customize_register_with_deleted_sidebars() { |
| 109 | $sidebar_id = 'sidebar-1'; |
| 110 | delete_option( 'sidebars_widgets' ); |
| 111 | register_sidebar( array( 'id' => $sidebar_id ) ); |
| 112 | $this->manager->widgets->customize_register(); |
| 113 | $this->assertEquals( array_fill_keys( array( 'wp_inactive_widgets', $sidebar_id ), array() ), wp_get_sidebars_widgets() ); |
| 114 | } |
| 115 | |
| 116 | /** |
102 | 117 | * Tests WP_Customize_Widgets::get_selective_refreshable_widgets(). |
103 | 118 | * |
104 | 119 | * @see WP_Customize_Widgets::get_selective_refreshable_widgets() |