WP_Font_Face::validate_fonts
Validates each of the font-face properties.
Method of the class: WP_Font_Face{}
No Hooks.
Returns
Array. Prepared font-faces organized by provider and font-family.
Usage
// private - for code of main (parent) class only $result = $this->validate_fonts( $fonts );
- $fonts(array) (required)
- The fonts to valid.
Changelog
| Since 6.4.0 | Introduced. |
WP_Font_Face::validate_fonts() WP Font Face::validate fonts code WP 7.0
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;
}