mymizan / wp-check-if-plugin-active

Check if a WordPress plugin is active

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check If a Plugin is Active

On a WordPress site, plugins can be (1) activated on the site, (2) network activated on a multisite and (3) added as a must use plugin. This class adds method to check if a plugin is active in all these cases.

Please, read the associated blog post.

Example

// Check if WooCommerce is active.
Utils_Plugins::is_active('woocommerce.php'); //True|False

// Check if WooCommerce is network active.
Utils_Plugins::is_network_active('woocommerce.php'); //True|False

// Check if a plugin is added as must use (mu-plugins).
Utils_Plugins::is_mu_active('plugin.php');  //True|False

About

Check if a WordPress plugin is active

License:GNU General Public License v3.0


Languages

Language:PHP 100.0%