W3cubDocs

/WordPress

WP_Font_Face_Resolver::get_fonts_from_theme_json(): array

Gets fonts defined in theme.json.

Return

array Returns the font-families, each with their font-face variations.

Source

public static function get_fonts_from_theme_json() {
	$settings = wp_get_global_settings();

	// Bail out early if there are no font settings.
	if ( empty( $settings['typography']['fontFamilies'] ) ) {
		return array();
	}

	return static::parse_settings( $settings );
}

Changelog

Version Description
6.4.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_font_face_resolver/get_fonts_from_theme_json