diff --git a/lib/experimental/fonts-api/class-wp-fonts-resolver.php b/lib/experimental/fonts-api/class-wp-fonts-resolver.php index fae5aba845b8f9..f2299c7c368311 100644 --- a/lib/experimental/fonts-api/class-wp-fonts-resolver.php +++ b/lib/experimental/fonts-api/class-wp-fonts-resolver.php @@ -202,9 +202,9 @@ private static function get_settings() { $settings = static::set_tyopgraphy_settings_array_structure( $settings ); // Initialize the font families from settings if set and is an array, otherwise default to an empty array. - $settings['typography']['fontFamilies']['theme'] = ( isset( $settings['typography']['fontFamilies']['theme'] ) && is_array( $settings['typography']['fontFamilies']['theme'] ) ) - ? $settings['typography']['fontFamilies']['theme'] - : array(); + if ( ! isset( $settings['typography']['fontFamilies']['theme'] ) || ! is_array( $settings['typography']['fontFamilies']['theme'] ) ) { + $settings['typography']['fontFamilies']['theme'] = array(); + } } // Initialize the font families from variation if set and is an array, otherwise default to an empty array.