From f281e7292232904ea071f03105666d61c98fe804 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 10 Jul 2014 15:49:14 +0000 Subject: [PATCH] is_active_widget() should skip orphaned widgets. props Ninos Ego. fixes #28810. Built from https://develop.svn.wordpress.org/trunk@29064 git-svn-id: http://core.svn.wordpress.org/trunk@28850 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/widgets.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 762bf57fcf..ecb5cb4c29 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -1142,8 +1142,9 @@ function is_active_widget($callback = false, $widget_id = false, $id_base = fals if ( is_array($sidebars_widgets) ) { foreach ( $sidebars_widgets as $sidebar => $widgets ) { - if ( $skip_inactive && 'wp_inactive_widgets' == $sidebar ) + if ( $skip_inactive && ( 'wp_inactive_widgets' === $sidebar || 'orphaned_widgets' === substr( $sidebar, 0, 16 ) ) ) { continue; + } if ( is_array($widgets) ) { foreach ( $widgets as $widget ) { @@ -1424,8 +1425,9 @@ function retrieve_widgets( $theme_changed = false ) { } foreach ( $_sidebars_widgets as $sidebar => $widgets ) { - if ( 'wp_inactive_widgets' == $sidebar || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) ) + if ( 'wp_inactive_widgets' === $sidebar || 'orphaned_widgets' === substr( $sidebar, 0, 16 ) ) { continue; + } if ( !in_array( $sidebar, $registered_sidebar_keys ) ) { $_sidebars_widgets['orphaned_widgets_' . ++$orphaned] = $widgets;