Also, How to Check Plugin Status
Ever wonder if your widget is activated on an external site?
Here’s how to find out.
When you register a sidebar widget, you use code like this:
register_sidebar_widget(array('Name of Widget', 'class-of-widget'), 'widget_function');
If you want to check whether the widget is activated (you may want to for a variety of reasons), you can do it like this (the “class-of-widget” value from above will be used in the code below): if(isset($_REQUEST['check_status'])) {
if(is_active_widget('class-of-widget')) {
echo 'Active';
} else {
echo 'Inactive';
} // End if 'is_active_widget'
} // End if 'check_status'
Now, simply browse to your widget’s location and add the variable “check_status” at the end: (wp-content/plugins/your-plugin/widget.php?check_status
). You will then see the plugin/widget is “Active” or “Inactive.”
I hope someone finds this useful; if you’re in plugin or widget development for WordPress, try the code out!
4 replies on “How to Tell if Your WordPress Widget is Active”
Ah ha ! What an elegant solution. Thank you.
Thanks. And in the new API ?
hi this is naqvi,
I am new to wordpress and not very much familiar with SEO,
I just added wordspinner in my blog. but how i could add tags meta data key word and title in my pages. I mean syntax and where i have to add these entries.
thanks
Naqvi.
This is good Zack. I could tell if someone has my plugin, but isn’t using it and ask for feedback or offer to help.