From 273b13c9bf5f5f0faf07a93cd7657544a29d7380 Mon Sep 17 00:00:00 2001 From: costdev Date: Mon, 4 Nov 2024 17:08:08 +0000 Subject: [PATCH] Delete all settings when the plugin is uninstalled. --- aspire-update.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aspire-update.php b/aspire-update.php index 05c24f5..973f198 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(); +} \ No newline at end of file