Advertisement
qlstudio

4 Trees - WordPress check if plugin is active

Nov 12th, 2012
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.32 KB | None | 0 0
  1. /**
  2.  * check if a plugin is active ##
  3.  */
  4. if ( !function_exists( 'ftf_plugin_is_active' ) ) {
  5. function ftf_plugin_is_active( $plugin ) {
  6.     return in_array( $plugin, (array) get_option( 'active_plugins', array() ) );
  7. }}
  8.  
  9. // example usage ##
  10. if ( ftf_plugin_is_active( 'mailchimp/mailchimp.php' ) ) {
  11.     // do stuff ##
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement