From c117b828e8ea022ab614020fd5d53cf7a95f8c27 Mon Sep 17 00:00:00 2001 From: Michael Ochmann Date: Mon, 2 Feb 2026 12:01:48 +0100 Subject: [PATCH] fixed bug, where a services has not been disabled when the URL has been emptied --- src/Settings.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Settings.php b/src/Settings.php index 1c5adb6..dcd450f 100644 --- a/src/Settings.php +++ b/src/Settings.php @@ -70,7 +70,12 @@ class Settings { // someone needs to do something useful with the information // submitted. The filter is called // "wpsi_save_services" - $value = json_decode(html_entity_decode(stripslashes($_POST["services"]))); + $value = json_decode(html_entity_decode(stripslashes($_POST["services"]))); + // here we delete empty entries, because they should be deactivated + foreach ($value as $key => $url) { + if ($url === "") + unset($value->$key); + } $services = json_encode(apply_filters("wpsi_save_services", $value)); update_option(Plugin::OPTIONS_KEY, $services);