W3cubDocs

/WordPress

WP_Font_Face::validate_fonts( array $fonts ): array

Validates each of the font-face properties.

Parameters

$fontsarrayrequired
The fonts to valid.

Return

array Prepared font-faces organized by provider and font-family.

Source

private function validate_fonts( array $fonts ) {
	$validated_fonts = array();

	foreach ( $fonts as $font_faces ) {
		foreach ( $font_faces as $font_face ) {
			$font_face = $this->validate_font_face_declarations( $font_face );
			// Skip if failed validation.
			if ( false === $font_face ) {
				continue;
			}

			$validated_fonts[] = $font_face;
		}
	}

	return $validated_fonts;
}

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/validate_fonts