Created
April 12, 2016 04:55
-
-
Save j-cam/3914e5479e6793f92f22842bd1c423ca to your computer and use it in GitHub Desktop.
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
<?php | |
if ( !function_exists( 'get_home_path' ) ) | |
require_once( dirname(__FILE__) . '/../../../wp-admin/includes/file.php' ); | |
add_action( 'admin_init', array(&$this, 'has_acf') ); | |
public function has_acf() { | |
if ( is_admin() && current_user_can( 'activate_plugins' ) && !is_plugin_active( 'advanced-custom-fields-pro/acf.php' ) ) { | |
add_action( 'admin_notices', array(&$this, 'acf_not_activated_notice') ); | |
deactivate_plugins( plugin_basename( __FILE__ ) ); | |
if ( isset( $_GET['activate'] ) ) { | |
unset( $_GET['activate'] ); | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment