浏览代码

radcliffe-2: PHP 8.1 updates from wpcom (#7584)

Matthew Reishus 1 年之前
父节点
当前提交
662c5718b0
共有 1 个文件被更改,包括 12 次插入3 次删除
  1. 12 3
      radcliffe-2/contact-info/contact-info-functions.php

+ 12 - 3
radcliffe-2/contact-info/contact-info-functions.php

@@ -5,9 +5,18 @@ if ( ! function_exists( 'radcliffe_2_contact_info' ) ) :
  */
 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',   '' );