WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/04/2017 08:16:43 PM (6 months 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.
See #42603.

Merges [42362] to the 4.9 branch.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/tests/phpunit/tests/widgets.php

    r41673 r42363  
    710710
    711711        wp_widgets_init();
    712         $this->register_sidebars( array( 'sidebar-1', 'sidebar-2', 'sidebar-3', 'wp_inactive_widgets' ) );
     712        $this->register_sidebars( array( 'sidebar-1', 'sidebar-2', 'sidebar-3', 'sidebar-4', 'wp_inactive_widgets' ) );
    713713
    714714        // Test restoring sidebars widgets when previously activated.
     
    719719                'sidebar-2' => array(),
    720720                'sidebar-3' => array( 'unregistered_widget-1', 'text-1', 'media_image-1' ),
     721                'sidebar-4' => null, // Should be converted to array.
    721722                'orphaned_widgets_1' => array( 'media_video-2' ),
    722723            ),
Note: See TracChangeset for help on using the changeset viewer.