WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/04/2017 08:11:11 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.
Fixes #42603.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets.php

    r42343 r42362  
    13341334    if ( is_array( $old_sidebars_widgets ) ) {
    13351335
     1336        // Remove empty sidebars, no need to map those.
     1337        $old_sidebars_widgets = array_filter( $old_sidebars_widgets );
     1338
    13361339        // Only check sidebars that are empty or have not been mapped to yet.
    13371340        foreach ( $new_sidebars_widgets as $new_sidebar => $new_widgets ) {
Note: See TracChangeset for help on using the changeset viewer.