use wordpress is_active_widget

This commit is contained in:
John Bintz 2010-01-25 20:31:09 -05:00
parent e1329e5f53
commit 6fca81a311

View File

@ -40,24 +40,12 @@ class ComicPressWidgets {
$widget->init();
}
$available_widgets[strtolower($class_name)] = $widget;
}
}
closedir($dh);
}
foreach (wp_get_sidebars_widgets() as $type => $widgets) {
if ($type != 'wp_inactive_widgets') {
foreach ($widgets as $widget_id) {
foreach ($available_widgets as $key => $widget) {
if (method_exists($widget, 'is_active')) {
if (strpos(strtolower($widget_id), $key) === 0) {
if (is_active_widget(false, false, strtolower($class_name))) {
$widget->is_active();
}
}
}
}
}
closedir($dh);
}
}
}