Check If WooCommerce Plugin is activated or not?

For WordPress plugin developers, it’s a very common practice to check if depended/required plugin has been activated or not before executing their own plugin code. Yesterday, working on few updates of FAQ Tab For WooCommerce – Advanced FAQ Addon. Then added following lines of code to check if WooCommerce plugin already installed and activated in my site or not.

If WooCommerce plugin installed and activated then FAQ Tab For WooCommerce – Advanced FAQ Addon run it’s own code. Other wise, it display a notification message in admin panel.

if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
// Write your code if WooCommerce Plugin activated.
} else {
// Write your code if WooCommerce Plugin is disabled.
// You can display notice message in here.
}

I hope this little tips will help you.

Thanks and Enjoy !

Advertisement

Tags:  

Share It

Related Posts