$aster_photography_font['family'], 'variants' => $aster_photography_font['variants'], ); } return $aster_photography_google_fonts; } function aster_photography_get_all_google_font_families() { $aster_photography_google_fonts = aster_photography_get_all_google_fonts(); $aster_photography_font_families = array(); foreach ( $aster_photography_google_fonts as $aster_photography_font ) { $aster_photography_font_families[ $aster_photography_font['family'] ] = $aster_photography_font['family']; } return $aster_photography_font_families; } function aster_photography_get_fonts_url() { $aster_photography_fonts_url = ''; $aster_photography_fonts = array(); $aster_photography_all_fonts = aster_photography_get_all_google_fonts(); if ( ! empty( get_theme_mod( 'aster_photography_site_title_font', 'Dynalight' ) ) ) { $aster_photography_fonts[] = get_theme_mod( 'aster_photography_site_title_font', 'Dynalight' ); } if ( ! empty( get_theme_mod( 'aster_photography_site_description_font', 'Mulish' ) ) ) { $aster_photography_fonts[] = get_theme_mod( 'aster_photography_site_description_font', 'Mulish' ); } if ( ! empty( get_theme_mod( 'aster_photography_header_font', 'Cormorant Garamond' ) ) ) { $aster_photography_fonts[] = get_theme_mod( 'aster_photography_header_font', 'Cormorant Garamond' ); } if ( ! empty( get_theme_mod( 'aster_photography_content_font', 'Mulish' ) ) ) { $aster_photography_fonts[] = get_theme_mod( 'aster_photography_content_font', 'Mulish' ); } $aster_photography_fonts = array_unique( $aster_photography_fonts ); foreach ( $aster_photography_fonts as $aster_photography_font ) { $aster_photography_variants = $aster_photography_all_fonts[ $aster_photography_font ]['variants']; $aster_photography_font_family[] = $aster_photography_font . ':' . implode( ',', $aster_photography_variants ); } $aster_photography_query_args = array( 'family' => urlencode( implode( '|', $aster_photography_font_family ) ), ); if ( ! empty( $aster_photography_font_family ) ) { $aster_photography_fonts_url = add_query_arg( $aster_photography_query_args, 'https://fonts.googleapis.com/css' ); } return $aster_photography_fonts_url; }