Last active
July 4, 2024 14:28
-
-
Save someguy9/4e5b450822f2333d1b4c5c0f30473dc3 to your computer and use it in GitHub Desktop.
Check if WordPress plugin is active
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Checking if a WordPress plugin (works for admin or front end) | |
if ( in_array( 'plugin-directory/main-plugin-file.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { | |
// Plugin is active | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment