Checks if the Genesis Framework is active. If not, it deactivates the plugin.
<?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' );