Created
August 12, 2015 14:54
-
-
Save Jany-M/8aa4519997e7e8f7cd0d to your computer and use it in GitHub Desktop.
[WordPress] Check from Frontend/Theme if a 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 // Check from theme if a plugin is active - Place in functions.php or similar | |
if(!function_exists('plugin_is_active')) { | |
function plugin_is_active($plugin_folder, $plugin_file) { | |
if(!isset($plugin_file) || $plugin_file == '') $plugin_file = $plugin_folder; | |
return in_array($plugin_folder.'/'.$plugin_file.'.php', apply_filters('active_plugins', get_option('active_plugins'))); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment