mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Widgets: Don't try mapping empty sidebars.
Fixes a bug where the mapping logic would try mapping empty sidebars, resulting in PHP warnings. Props ionvv, chetan200891 for initial patch. Fixes #42603. git-svn-id: https://develop.svn.wordpress.org/trunk@42362 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -729,7 +729,7 @@ class Tests_Widgets extends WP_UnitTestCase {
|
||||
global $sidebars_widgets, $_wp_sidebars_widgets;
|
||||
|
||||
wp_widgets_init();
|
||||
$this->register_sidebars( array( 'sidebar-1', 'sidebar-2', 'sidebar-3', 'wp_inactive_widgets' ) );
|
||||
$this->register_sidebars( array( 'sidebar-1', 'sidebar-2', 'sidebar-3', 'sidebar-4', 'wp_inactive_widgets' ) );
|
||||
|
||||
// Test restoring sidebars widgets when previously activated.
|
||||
set_theme_mod(
|
||||
@@ -739,6 +739,7 @@ class Tests_Widgets extends WP_UnitTestCase {
|
||||
'sidebar-1' => array( 'tag_cloud-1' ),
|
||||
'sidebar-2' => array(),
|
||||
'sidebar-3' => array( 'unregistered_widget-1', 'text-1', 'media_image-1' ),
|
||||
'sidebar-4' => null, // Should be converted to array.
|
||||
'orphaned_widgets_1' => array( 'media_video-2' ),
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user