From 0f81e3c1bb6a0587d0b531ca07a746744964e763 Mon Sep 17 00:00:00 2001 From: Steve Brett Date: Thu, 30 Jul 2020 17:09:40 +0100 Subject: [PATCH] Update ultimate-mailchimp-plugin.php Issue: GDPR fields won't update if already set in options. Fix: update fields before getting them. --- ultimate-mailchimp-plugin.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ultimate-mailchimp-plugin.php b/ultimate-mailchimp-plugin.php index 27679d8..6ee1188 100644 --- a/ultimate-mailchimp-plugin.php +++ b/ultimate-mailchimp-plugin.php @@ -7,7 +7,7 @@ * Author URI: atomicsmash.co.uk * Text Domain: testing * Domain Path: /languages - * Version: 0.0.1 + * Version: 0.0.4 * * @package Testing */ @@ -245,11 +245,8 @@ public function add_woocommerce_checkout_custom_fields( $checkout ) { //ASTODO add logic to detect if the user is current signed up to the newsletter if ( defined('ULTIMATE_MAILCHIMP_GDPR_FIELDS') && ULTIMATE_MAILCHIMP_GDPR_FIELDS == true ) { - $permission_fields = get_option( 'um_communication_permission_fields' ); - - if( $permission_fields == "" ){ - $permission_fields = $this->update_communication_preference_options(); - } + $this->update_communication_preference_options(); + $permission_fields = get_option('um_communication_permission_fields'); }else{ $permission_fields = ""; }