diff --git a/aspire-update.php b/aspire-update.php index 05c24f5..4c49a08 100644 --- a/aspire-update.php +++ b/aspire-update.php @@ -46,3 +46,13 @@ function aspire_update() { new AspireUpdate\Controller(); } } + +register_activation_hook( __FILE__, 'aspire_update_activation_hook' ); +function aspire_update_activation_hook() { + register_uninstall_hook( __FILE__, 'aspire_update_uninstall_hook' ); +} + +function aspire_update_uninstall_hook() { + $admin_settings = AspireUpdate\Admin_Settings::get_instance(); + $admin_settings->delete_all_settings(); +} diff --git a/includes/class-admin-settings.php b/includes/class-admin-settings.php index 81cd8f5..b4114b6 100644 --- a/includes/class-admin-settings.php +++ b/includes/class-admin-settings.php @@ -103,6 +103,15 @@ public function reset_settings() { } } + /** + * Delete all settings. + * + * @return void + */ + public function delete_all_settings() { + delete_site_option( $this->option_name ); + } + /** * The Admin Notice to convey a Reset Operation has happened. *