Home PHP Check if WordPress Plugin is Active

Check if WordPress Plugin is Active

is plugin active

If you are developing a Plugin which is dependent on another plugin, in such cases, we need to check if plugin is activated or not. To give an example, if you need to build a plugin which stores favorite products on wishlist, then you need to check if Woocommerce is activated or not.

WordPress doesn’t provide this facility by default. But, we can achieve this through simple step. There are various methods for this. Let’s check WordPress default is_plugin_active function.

Tip: New in WordPress? Don’t forget to read Template Hierarchy in WordPress.

If the above function does not work for you, there is an alternative. We can check if plugin class exists or not. This is a default PHP function which accepts class name as a parameter. Some of the popular plugins and checks if they are activated or not is given below:

Tip: Check if Table or Column already exists in Database?

NO COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Exit mobile version