get( 'Version' ) ); } add_action( 'wp_enqueue_scripts', 'blockbase_scripts' ); /** * Add Google webfonts * * @return $fonts_url */ function blockbase_fonts_url() { if ( ! class_exists( 'WP_Theme_JSON_Resolver_Gutenberg' ) ) { return ''; } $theme_data = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data()->get_settings(); if ( empty( $theme_data ) || empty( $theme_data['custom'] ) ) { return ''; } $custom_data = $theme_data['custom']; if ( ! array_key_exists( 'fontsToLoadFromGoogle', $custom_data ) ) { return ''; } $font_families = $theme_data['custom']['fontsToLoadFromGoogle']; $font_families[] = 'display=swap'; // Make a single request for the theme fonts. return esc_url_raw( 'https://fonts.googleapis.com/css2?' . implode( '&', $font_families ) ); } /** * Customize Global Styles */ require get_template_directory() . '/inc/customization.php';