From 6fca81a311b244b9fe105784a327a1d0ba5d4d0b Mon Sep 17 00:00:00 2001 From: John Bintz Date: Mon, 25 Jan 2010 20:31:09 -0500 Subject: [PATCH] use wordpress is_active_widget --- comicpress-widgets.php | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/comicpress-widgets.php b/comicpress-widgets.php index 9118b73..7609869 100644 --- a/comicpress-widgets.php +++ b/comicpress-widgets.php @@ -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) { - $widget->is_active(); - } - } + if (is_active_widget(false, false, strtolower($class_name))) { + $widget->is_active(); } } } + closedir($dh); } } }