Clear recurring order milestones event on plugin deactivation.
This commit is contained in:
parent
6f2c11270b
commit
f734f01598
|
@ -88,6 +88,7 @@ class WC_Admin_Notes_Order_Milestones {
|
|||
$this->allowed_statuses = apply_filters( 'woocommerce_admin_order_milestone_statuses', $this->allowed_statuses );
|
||||
|
||||
add_action( 'woocommerce_after_register_post_type', array( $this, 'init' ) );
|
||||
register_deactivation_hook( WC_ADMIN_PLUGIN_FILE, array( $this, 'clear_scheduled_event' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -107,6 +108,13 @@ class WC_Admin_Notes_Order_Milestones {
|
|||
add_action( self::PROCESS_ORDERS_MILESTONE_HOOK, array( $this, 'other_milestones' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear out our hourly milestone hook upon plugin deactivation.
|
||||
*/
|
||||
public function clear_scheduled_event() {
|
||||
wp_clear_scheduled_hook( self::PROCESS_ORDERS_MILESTONE_HOOK );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the total count of orders (in the allowed statuses).
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue