Skip to content

Commit 8da490c

Browse files
committed
Remove active/deactive hooks
1 parent 5d87dad commit 8da490c

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

discount-percentage-for-woocommerce.php

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,29 +30,11 @@
3030
*/
3131
if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
3232
// Yes, WooCommerce is enabled
33-
register_activation_hook(__FILE__, 'discount_percentage_for_woocommerce_activate');
33+
add_action('plugins_loaded', 'discount_percentage_for_woocommerce_plugin_init');
34+
add_filter('woocommerce_sale_flash', 'discount_percentage_for_woocommerce');
3435
} else {
3536
// WooCommerce is NOT enabled!
3637
add_action('admin_notices', 'discount_percentage_for_woocommerce_plugin_notice');
37-
register_deactivation_hook(__FILE__, 'discount_percentage_for_woocommerce_deactivate');
38-
39-
}
40-
41-
/**
42-
* Activate the plugin.
43-
*/
44-
function discount_percentage_for_woocommerce_activate()
45-
{
46-
add_action('plugins_loaded', 'discount_percentage_for_woocommerce_plugin_init');
47-
add_filter('woocommerce_sale_flash', 'discount_percentage_for_woocommerce');
48-
}
49-
50-
/**
51-
* Deactivation hook.
52-
*/
53-
function discount_percentage_for_woocommerce_deactivate()
54-
{
55-
remove_filter('woocommerce_sale_flash', 'discount_percentage_for_woocommerce');
5638
}
5739

5840
/**

0 commit comments

Comments
 (0)