From 54b8932923ffb3fb11c78f7e0c00142700a66a88 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 24 Feb 2016 01:37:26 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@36667 git-svn-id: http://core.svn.wordpress.org/trunk@36634 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-includes/widgets.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index 956170e87e..7dc30bc13e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-36666'; +$wp_version = '4.5-alpha-36667'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index b24b465503..ace4571816 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -830,7 +830,7 @@ function is_dynamic_sidebar() { global $wp_registered_widgets, $wp_registered_sidebars; $sidebars_widgets = get_option('sidebars_widgets'); foreach ( (array) $wp_registered_sidebars as $index => $sidebar ) { - if ( count($sidebars_widgets[$index]) ) { + if ( ! empty( $sidebars_widgets[ $index ] ) ) { foreach ( (array) $sidebars_widgets[$index] as $widget ) if ( array_key_exists($widget, $wp_registered_widgets) ) return true;