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);