fix a warning in the case where the fonts aren't defined

This commit is contained in:
Ben Dwyer 2021-03-15 16:18:15 +00:00
parent b6f0bcb662
commit 273a5db258

View file

@ -50,9 +50,10 @@ function blank_canvas_blocks_fonts_url() {
$fonts_url = '';
$theme_data = WP_Theme_JSON_Resolver::get_merged_data()->get_settings();
$font_families = $theme_data['defaults']['custom']['fontsToLoadFromGoogle'];
$custom_data = $theme_data['defaults']['custom'];
if ( array_key_exists( 'fontsToLoadFromGoogle', $custom_data ) ) {
$font_families = $theme_data['defaults']['custom']['fontsToLoadFromGoogle'];
if ( $font_families ) {
$font_families[] = 'display=swap';
// Make a single request for the theme fonts.