Categories
Web Development WordPress

How to Tell if Your WordPress Widget is Active

Check your  widget activation & settings

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!

By Zack Katz

Zack Katz is the founder of GravityKit and TrustedLogin. He lives in Leverett, Massachusetts with his wife Juniper.

4 replies on “How to Tell if Your WordPress Widget is Active”

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.

Comments are closed.