From db431b9917cc2ea3f4296842f37993abeabda940 Mon Sep 17 00:00:00 2001 From: Bogdan Preda Date: Wed, 8 Jan 2020 18:48:18 +0200 Subject: [PATCH] fix: prevent losing filters settings after disconnecting the api key, fix #210 Co-authored-by: GrigoreMihai <40674950+GrigoreMihai@users.noreply.github.com> --- inc/settings.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/inc/settings.php b/inc/settings.php index 101dd9b1..ac290b18 100644 --- a/inc/settings.php +++ b/inc/settings.php @@ -402,9 +402,12 @@ public function get_cdn_url() { * @return bool Reset action status. */ public function reset() { - $update = update_option( $this->namespace, $this->default_schema ); + $reset_schema = $this->default_schema; + $reset_schema['filters'] = $this->options['filters']; + + $update = update_option( $this->namespace, $reset_schema ); if ( $update ) { - $this->options = $this->default_schema; + $this->options = $reset_schema; } return $update;