Skip to content

Commit e35d78d

Browse files
committed
Woocommerce Check
1 parent 0e31be2 commit e35d78d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

product-brands.php

+8
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515
require_once(plugin_dir_path(__FILE__) . 'includes/class-product-brand-admin.php');
1616
require_once(plugin_dir_path(__FILE__) . 'includes/class-product-brand-meta.php');
1717

18+
function my_plugin_activation_hook() {
19+
if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
20+
deactivate_plugins( plugin_basename( __FILE__ ) );
21+
wp_die( 'Sorry, but this plugin requires WooCommerce to be installed and activated.' );
22+
}
23+
}
24+
25+
register_activation_hook( __FILE__, 'my_plugin_activation_hook' );
1826

1927
// Define the function that registers the plugin
2028
function my_product_brand_plugin() {

0 commit comments

Comments
 (0)