mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Fix widgets using old-style multi instance support. Props mdawaffe. fixes #6023
git-svn-id: https://develop.svn.wordpress.org/trunk@7080 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -252,7 +252,7 @@ function dynamic_sidebar($index = 1) {
|
||||
|
||||
/* @return mixed false if widget is not active or id of sidebar in which the widget is active
|
||||
*/
|
||||
function is_active_widget($callback) {
|
||||
function is_active_widget($callback, $widget_id = false) {
|
||||
global $wp_registered_widgets;
|
||||
|
||||
$sidebars_widgets = wp_get_sidebars_widgets(false);
|
||||
@@ -260,7 +260,9 @@ function is_active_widget($callback) {
|
||||
if ( is_array($sidebars_widgets) ) foreach ( $sidebars_widgets as $sidebar => $widgets )
|
||||
if ( is_array($widgets) ) foreach ( $widgets as $widget )
|
||||
if ( isset($wp_registered_widgets[$widget]['callback']) && $wp_registered_widgets[$widget]['callback'] == $callback )
|
||||
return $sidebar;
|
||||
if ( !$widget_id || $widget_id == $wp_registered_widgets[$widget]['id'] )
|
||||
return $sidebar;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user