WP_Font_Face::validate_fonts( array $fonts ): array

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

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

VersionDescription
6.4.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.