Created
January 29, 2015 00:04
-
-
Save daronspence/c4b8ee92916c617d52be to your computer and use it in GitHub Desktop.
Is plugin installed
This file contains hidden or 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
$installed_plugins = array(); | |
// check if ACF is installed | |
if ( is_multisite() ) : | |
$network_plugins = get_site_option( 'active_sitewide_plugins', array() ); | |
$site_plugins = get_option( 'active_plugins', array() ); | |
$installed_plugins = array_merge($network_plugins, $site_plugins); | |
else : | |
$installed_plugins = get_option( 'active_plugins', array() ); | |
endif; | |
foreach($installed_plugins as $key => $value ){ | |
if ( strpos($key, 'acf.php') !== false || strpos($value, 'acf.php') !== false ){ | |
$acf_active = true; | |
return; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment