Created
May 31, 2016 17:52
-
-
Save timothyjensen/e70cce23c881f3c554e80d15d26a5390 to your computer and use it in GitHub Desktop.
Checks if the Genesis Framework is active. If not, it deactivates the plugin.
This file contains 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 | |
/** | |
* This function is triggered when the WordPress theme is changed. | |
* It checks if the Genesis Framework is active. If not, it deactivates the plugin. | |
* | |
* @since 1.0 | |
* @author Chimnoy Paul | |
*/ | |
function gcfws_plugin_deactivate() { | |
if ( ! function_exists( 'genesis' ) ) { | |
// Deactivate. | |
deactivate_plugins( plugin_basename( __FILE__ ) ); | |
add_action( 'admin_notices', 'gcfws_admin_notice_message' ); | |
} | |
} | |
add_action( 'admin_init', 'gcfws_plugin_deactivate' ); | |
add_action( 'switch_theme', 'gcfws_plugin_deactivate' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment