WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/04/17 20:11:11 (7 weeks ago)
Author:
obenland
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/widgets.php

    r42343 r42362  
    730730 
    731731        wp_widgets_init(); 
    732         $this->register_sidebars( array( 'sidebar-1', 'sidebar-2', 'sidebar-3', 'wp_inactive_widgets' ) ); 
     732        $this->register_sidebars( array( 'sidebar-1', 'sidebar-2', 'sidebar-3', 'sidebar-4', 'wp_inactive_widgets' ) ); 
    733733 
    734734        // Test restoring sidebars widgets when previously activated. 
     
    740740                    'sidebar-2'          => array(), 
    741741                    'sidebar-3'          => array( 'unregistered_widget-1', 'text-1', 'media_image-1' ), 
     742                    'sidebar-4'          => null, // Should be converted to array. 
    742743                    'orphaned_widgets_1' => array( 'media_video-2' ), 
    743744                ), 
Note: See TracChangeset for help on using the changeset viewer.