Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Activation Class
- **/
- if ( ! class_exists( 'WC_CPInstallCheck' ) ) {
- class WC_CPInstallCheck {
- static function install() {
- /**
- * Check if WooCommerce & Cubepoints are active
- **/
- // !is_plugin_active('woocommerce/woocommerce.php')
- if ( !in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ||
- !in_array( 'cubepoints/cubepoints.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
- // Deactivate the plugin
- deactivate_plugins(__FILE__);
- // Throw an error in the wordpress admin console
- $error_message = __('This plugin requires <a href="http://wordpress.org/extend/plugins/woocommerce/">WooCommerce</a> & <a href="http://wordpress.org/extend/plugins/cubepoints/">Cubepoints</a> plugins to be active!', 'woocommerce');
- die($error_message);
- }
- }
- }
- }
- register_activation_hook( __FILE__, array('WC_CPInstallCheck', 'install') );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement