Skip to content

Instantly share code, notes, and snippets.

@shaunpalmer
Forked from wpscholar/is_plugin_active.php
Created September 15, 2024 02:23
Show Gist options
  • Save shaunpalmer/888ddf10f7f92b11d0d1ac204d9a955f to your computer and use it in GitHub Desktop.
Save shaunpalmer/888ddf10f7f92b11d0d1ac204d9a955f to your computer and use it in GitHub Desktop.
Test if a WordPress plugin is active
<?php
/**
* Test if a WordPress plugin is active
*/
if ( is_plugin_active('plugin-directory/plugin-file.php') ) {
// the plugin is active
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment