From 3bfc463efe7d75701f9f65f31e1d6ba1cd380acb Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Mon, 13 Jul 2026 10:45:08 -0500 Subject: [PATCH 1/3] reference as an array and not an object --- includes/class-api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-api.php b/includes/class-api.php index 86bd3a2f..e43ff37a 100644 --- a/includes/class-api.php +++ b/includes/class-api.php @@ -1486,7 +1486,7 @@ public function get_disclosure_info( $as_parts = false ) { } $disclosure = [ - 'name' => empty( $account_info->organization_name ) ? constant_contact_get_option( '_ctct_disclose_name', '' ) : $account_info->organization_name, + 'name' => empty( $account_info['organization_name'] ) ? constant_contact_get_option( '_ctct_disclose_name', '' ) : $account_info['organization_name'], 'address' => constant_contact_get_option( '_ctct_disclose_address', '' ), ]; From ba8e3089e6773dc6c3ec9ea3c3142206243b89be Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Mon, 13 Jul 2026 10:45:42 -0500 Subject: [PATCH 2/3] fix issues with saving opt-in page settings that cause lost settings --- includes/class-settings.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/class-settings.php b/includes/class-settings.php index 859ddac5..3de3aa6a 100644 --- a/includes/class-settings.php +++ b/includes/class-settings.php @@ -451,7 +451,9 @@ protected function register_fields_optin() { $cmb = new_cmb2_box( $this->get_cmb_args( 'optin' ) ); if ( empty( $_GET['page'] ) || 'ctct_options_settings_optin' !== $_GET['page'] ) { - return; + if ( empty( $_POST ) ) { + return; + } } if ( constant_contact()->get_api()->is_connected() ) { From 995ed0ba1a4b22b1a63ef97d04515e1f88f4b206 Mon Sep 17 00:00:00 2001 From: Michael Beckwith Date: Mon, 13 Jul 2026 10:46:12 -0500 Subject: [PATCH 3/3] show these fields regardless of disclosure info status --- includes/class-settings.php | 40 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/includes/class-settings.php b/includes/class-settings.php index 3de3aa6a..e4474577 100644 --- a/includes/class-settings.php +++ b/includes/class-settings.php @@ -499,27 +499,25 @@ protected function register_fields_optin() { ] ); - if ( empty( $disclosure_info ) ) { - $cmb->add_field( - [ - 'name' => esc_html__( 'Disclosure Name', 'constant-contact-forms' ), - 'id' => '_ctct_disclose_name', - 'type' => 'text', - 'default' => $business_name, - 'attributes' => ! empty( $business_name ) ? [ 'readonly' => 'readonly' ] : [], - ] - ); - - $cmb->add_field( - [ - 'name' => esc_html__( 'Disclosure Address', 'constant-contact-forms' ), - 'id' => '_ctct_disclose_address', - 'type' => 'text', - 'default' => $business_addr, - 'attributes' => ! empty( $business_addr ) ? [ 'readonly' => 'readonly' ] : [], - ] - ); - } + $cmb->add_field( + [ + 'name' => esc_html__( 'Disclosure Name', 'constant-contact-forms' ), + 'id' => '_ctct_disclose_name', + 'type' => 'text', + 'default' => $business_name, + 'attributes' => ! empty( $business_name ) ? [ 'readonly' => 'readonly' ] : [], + ] + ); + + $cmb->add_field( + [ + 'name' => esc_html__( 'Disclosure Address', 'constant-contact-forms' ), + 'id' => '_ctct_disclose_address', + 'type' => 'text', + 'default' => $business_addr, + 'attributes' => ! empty( $business_addr ) ? [ 'readonly' => 'readonly' ] : [], + ] + ); $cmb->add_field( [