diff --git a/inc/quick_setup.php b/inc/quick_setup.php index 20c67be..0a964f3 100644 --- a/inc/quick_setup.php +++ b/inc/quick_setup.php @@ -114,8 +114,8 @@ if(isset($_POST['finish_quick_setup'])){ $email_from_addrss = isset($_POST['email_from_address']) ? sanitize_text_field($_POST['email_from_address']) : "no-reply@$url"; - $general_settings_data = get_option('general_setting_sec'); - $email_settings_data = get_option('email_setting_sec'); + $general_settings_data = get_option('general_setting_sec') ? get_option('general_setting_sec') : []; + $email_settings_data = get_option('email_setting_sec') ? get_option('email_setting_sec') : []; $update_general_settings_arr = [ 'mep_event_label' => $event_label, @@ -131,6 +131,8 @@ if(isset($_POST['finish_quick_setup'])){ $new_general_settings_data = array_replace($general_settings_data,$update_general_settings_arr); $new_email_settings_data = array_replace($email_settings_data,$update_email_settings_arr); + + update_option( 'general_setting_sec', $new_general_settings_data); update_option( 'email_setting_sec', $new_email_settings_data); update_option( 'mep_quick_setup', 'done');