From 88d4c0622f5ecfc1cd08c5dad8566530cffd1f08 Mon Sep 17 00:00:00 2001 From: rdowner22 Date: Tue, 23 Apr 2024 15:47:39 -0700 Subject: [PATCH] IMPB-1462: Fix deprecated php errors with Contact Form 7 when IDX Broker add on data does not exist --- idx/leads/class-contact-form-7.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/idx/leads/class-contact-form-7.php b/idx/leads/class-contact-form-7.php index c342d6000..f2bfc8a47 100644 --- a/idx/leads/class-contact-form-7.php +++ b/idx/leads/class-contact-form-7.php @@ -84,12 +84,12 @@ public static function idx_cf7_settings() { $option_name = 'idx_lead_form_' . $form_id; $form_options = get_option( $option_name ); - $checked = false; - // $form_options could be false if this is a new form (since get_option returns false when it can't find anything) - if ($form_options != false && array_key_exists('enable_lead', $form_options)) { - $checked = $form_options['enable_lead']; + if (!$form_options) { + $form_options = []; + $form_options['enable_lead'] = false; } + $checked = $form_options['enable_lead']; if ( ! isset( $form_options['category'] ) ) { $form_options['category'] = ''; }