use wordpress is_active_widget
This commit is contained in:
parent
e1329e5f53
commit
6fca81a311
|
@ -40,24 +40,12 @@ class ComicPressWidgets {
|
||||||
$widget->init();
|
$widget->init();
|
||||||
}
|
}
|
||||||
|
|
||||||
$available_widgets[strtolower($class_name)] = $widget;
|
if (is_active_widget(false, false, strtolower($class_name))) {
|
||||||
}
|
$widget->is_active();
|
||||||
}
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
closedir($dh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue