I’m trying to detect if "products categories" woocommerce widget (one of the most known plugins) is used in a sidebar.
according to the function: is_active_widget
I can provide:
- the
callback
(no idea what this is, but am guessing it’s the
function’s name that outputs the widget) - the
widget_id
- or finally the
id_base
after investigating woocommerce core code, the class name for this widget is WC_Widget_Product_Categories
while the widget_id
is: woocommerce_product_categories
.
so finally (with the widget added to a sidebar in my website) when I try:
var_dump(is_active_widget(false,false,'woocommerce_product_categories'));
I get false
returned all the time, even though this works for me on other plugins and the sidebar ID is returned.
I tried also removing the false
arguments one by one, still the sidebar ID is not returned.
kindly let me know if there is a way to achieve this result