Bail early in dynamic_sidebar() if there are no sidebars. fixes #14816.

git-svn-id: https://develop.svn.wordpress.org/trunk@17545 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2011-03-23 18:59:52 +00:00
parent 5fc7b13692
commit fd76a68a2d

View File

@ -854,6 +854,8 @@ function dynamic_sidebar($index = 1) {
}
$sidebars_widgets = wp_get_sidebars_widgets();
if ( empty( $sidebars_widgets ) )
return false;
if ( empty($wp_registered_sidebars[$index]) || !array_key_exists($index, $sidebars_widgets) || !is_array($sidebars_widgets[$index]) || empty($sidebars_widgets[$index]) )
return false;