Created
March 30, 2015 15:36
-
-
Save khromov/6455302c6e3ca826b093 to your computer and use it in GitHub Desktop.
How to kill WordPress plugin during activation if it's not compatible with the environment
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 | |
| /* Activation hook */ | |
| register_activation_hook( __FILE__, function() { | |
| if(!function_exists('\get_field')) { | |
| deactivate_plugins(__FILE__); | |
| wp_die("Please enable Advanced Custom Fields before activating this plugin."); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment