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/src/wp-includes/widgets.php

    r41942 r42363  
    12951295    if ( is_array( $old_sidebars_widgets ) ) {
    12961296
     1297        // Remove empty sidebars, no need to map those.
     1298        $old_sidebars_widgets = array_filter( $old_sidebars_widgets );
     1299
    12971300        // Only check sidebars that are empty or have not been mapped to yet.
    12981301        foreach ( $new_sidebars_widgets as $new_sidebar => $new_widgets ) {
Note: See TracChangeset for help on using the changeset viewer.