Check if dependencies are met before running deactivation hook (https://github.com/woocommerce/woocommerce-admin/pull/1797)
This commit is contained in:
parent
26de74dc30
commit
53f84e1b5d
|
@ -123,9 +123,11 @@ add_action( 'admin_init', 'wc_admin_possibly_deactivate_wc_admin_plugin' );
|
||||||
* On deactivating the wc-admin plugin.
|
* On deactivating the wc-admin plugin.
|
||||||
*/
|
*/
|
||||||
function wc_admin_deactivate_wc_admin_plugin() {
|
function wc_admin_deactivate_wc_admin_plugin() {
|
||||||
|
if ( wc_admin_dependencies_satisfied() ) {
|
||||||
wp_clear_scheduled_hook( 'wc_admin_daily' );
|
wp_clear_scheduled_hook( 'wc_admin_daily' );
|
||||||
WC_Admin_Reports_Sync::clear_queued_actions();
|
WC_Admin_Reports_Sync::clear_queued_actions();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
register_deactivation_hook( WC_ADMIN_PLUGIN_FILE, 'wc_admin_deactivate_wc_admin_plugin' );
|
register_deactivation_hook( WC_ADMIN_PLUGIN_FILE, 'wc_admin_deactivate_wc_admin_plugin' );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue