Remove table data on plugin deactivate
This commit is contained in:
parent
ea12ad086b
commit
9028488548
|
@ -56,6 +56,7 @@ class WC_Admin_Feature_Plugin {
|
||||||
public function init() {
|
public function init() {
|
||||||
$this->define_constants();
|
$this->define_constants();
|
||||||
register_activation_hook( WC_ADMIN_PLUGIN_FILE, array( $this, 'on_activation' ) );
|
register_activation_hook( WC_ADMIN_PLUGIN_FILE, array( $this, 'on_activation' ) );
|
||||||
|
register_deactivation_hook( WC_ADMIN_PLUGIN_FILE, array( $this, 'on_deactivation' ) );
|
||||||
add_action( 'plugins_loaded', array( $this, 'on_plugins_loaded' ) );
|
add_action( 'plugins_loaded', array( $this, 'on_plugins_loaded' ) );
|
||||||
add_filter( 'action_scheduler_store_class', array( $this, 'replace_actionscheduler_store_class' ) );
|
add_filter( 'action_scheduler_store_class', array( $this, 'replace_actionscheduler_store_class' ) );
|
||||||
}
|
}
|
||||||
|
@ -71,6 +72,16 @@ class WC_Admin_Feature_Plugin {
|
||||||
WC_Admin_Install::create_events();
|
WC_Admin_Install::create_events();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove WooCommerce Admin related table data.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function on_deactivation() {
|
||||||
|
require_once WC_ADMIN_ABSPATH . 'includes/class-wc-admin-install.php';
|
||||||
|
WC_Admin_Install::delete_table_data();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup plugin once all other plugins are loaded.
|
* Setup plugin once all other plugins are loaded.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue