WordPress.org

Make WordPress Core

Changeset 36667


Ignore:
Timestamp:
02/24/2016 01:36:21 AM (2 years ago)
Author:
SergeyBiryukov
Message:

Widgets: Avoid a PHP notice in is_dynamic_sidebar() is a sidebar is registered but does not yet have an index in the sidebars_widgets option.

Props dlh.
Fixes #35928.

File:
1 edited

Legend:

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

    r36130 r36667  
    831831    $sidebars_widgets = get_option('sidebars_widgets');
    832832    foreach ( (array) $wp_registered_sidebars as $index => $sidebar ) {
    833         if ( count($sidebars_widgets[$index]) ) {
     833        if ( ! empty( $sidebars_widgets[ $index ] ) ) {
    834834            foreach ( (array) $sidebars_widgets[$index] as $widget )
    835835                if ( array_key_exists($widget, $wp_registered_widgets) )
Note: See TracChangeset for help on using the changeset viewer.