mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@36667 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user