Skip to content

Instantly share code, notes, and snippets.

@daronspence
Created January 29, 2015 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daronspence/c4b8ee92916c617d52be to your computer and use it in GitHub Desktop.
Save daronspence/c4b8ee92916c617d52be to your computer and use it in GitHub Desktop.
Is plugin installed
$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