Programmatically Checking if a WordPress Plugin is Installed

When writing a WordPress plugin, it can sometimes be helpful to tell if another plugin is active or not, whether to prevent conflicts or to extend another plugin that you require as a dependency.

Fortunately, there’s a conditional function built into WordPress for just this task.

if ( is_plugin_active('the-plugin/the-plugin.php') ) {
 //do stuff
}

The is_plugin_active() function accepts the relative path to the plugin (from the wp-content/plugins directory) as an argument, and returns either TRUE or FALSE.

  • http://hsbeta.dzoic.com/blogs/hij353 replica oakleys

    Hello! I’m at work browsing your blog from my new iphone 3gs! Just wanted to say I love reading through your blog and look forward to all your posts! Carry on the great work!