From 662c5718b0e96d05c59e9c63e8f0da54197f517c Mon Sep 17 00:00:00 2001 From: Matthew Reishus Date: Thu, 4 Jan 2024 09:20:06 -0600 Subject: [PATCH] radcliffe-2: PHP 8.1 updates from wpcom (#7584) --- .../contact-info/contact-info-functions.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/radcliffe-2/contact-info/contact-info-functions.php b/radcliffe-2/contact-info/contact-info-functions.php index 7a7ceff31c..3b3617db02 100644 --- a/radcliffe-2/contact-info/contact-info-functions.php +++ b/radcliffe-2/contact-info/contact-info-functions.php @@ -5,9 +5,18 @@ */ function radcliffe_2_contact_info( $section ) { $location = get_theme_mod( 'radcliffe_2_contact_info_location', 'header' ); - $address = get_option( 'site_contact_info' )['address'] ?: get_theme_mod( 'radcliffe_2_contact_info_address', '' ); - $phone = get_option( 'site_contact_info' )['phone'] ?: get_theme_mod( 'radcliffe_2_contact_info_phone', '' ); - $email = get_option( 'site_contact_info' )['email'] ?: get_theme_mod( 'radcliffe_2_contact_info_email', '' ); + + $contact = get_option( 'site_contact_info' ); + if ( is_array( $contact ) ) { + $address = isset( $contact['address'] ) ? $contact['address'] : ''; + $phone = isset( $contact['phone'] ) ? $contact['phone'] : ''; + $email = isset( $contact['email'] ) ? $contact['email'] : ''; + } else { + $address = get_theme_mod( 'radcliffe_2_contact_info_address', '' ); + $phone = get_theme_mod( 'radcliffe_2_contact_info_phone', '' ); + $email = get_theme_mod( 'radcliffe_2_contact_info_email', '' ); + } + $email = $email ? antispambot( $email ) : ''; $hours = get_theme_mod( 'radcliffe_2_contact_info_hours', '' );