How to test if a plugin is active

Nothing complicated: Simply paste the code below where you need to test if a specific plugin is active. Don’t forget to update the plugin path on line 2!

<?php
   if (is_plugin_active('plugin-directory/plugin-file.php')) {
      // the plugin is active
   }
?>

Thanks to Cats Who Code for the cool tip!

Leave a Reply

Your email address will not be published. Required fields are marked *