O'Reilly logo

WordPress 3 Plugin Development Essentials by Everett Griffiths, Brian Bondari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing WordPress installed plugins

A slightly more complicated test involves seeing whether or not another plugin is installed. This can be useful if you have one plugin that depends on another, or perhaps you just need to test whether or not a site has all of the plugins you expect it to. We took this a step further. The following function lets you specify the required plugins and the required versions of those plugins:

/** * This relies on the output of WP's get_plugins() and * get_option('active_plugins') functions. * * @param array $required_plugins An associative array with * the names of the plugins and the required versions, e.g. * array( 'My Great Plugin' => '0.9', 'Some Other Plugin' => '1.0.1' ) * @return none An error message is registered ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required