Post Pic

Check if a WordPress plugin is active, the easy way

When working with lots and lots of plugins, it can be useful for developers to be able to check if a particular WordPress plugin is active or not. Just read this recipe to find out.

If you want to check if a WordPress plugin is active, just use the is_plugin_active() function. The function takes a single parameter, which is the path to the plugin, as shown in the example below:

<?php
if (is_plugin_active('plugin-directory/plugin-file.php')) {
    //plugin is activated
}
?>

One Response

Sep 01 2011 17:21

It’s important to note that this function is found in plugin.php which is not always included. If you want to use this function from within a template or another plugin, you will need to manually require plugin.php.

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required

WP Theme of the week

Sponsored Likebox