Generates and prints font-face styles for given fonts or theme.json fonts.
$fontsarray[][]optional
...$0 array...$0 arrayfont-family stringsrc string|string[]font-style string'normal'.font-weight string'400'.font-display string'fallback'.ascent-override stringdescent-override stringfont-stretch stringfont-variant stringfont-feature-settings stringfont-variation-settings stringline-gap-override stringsize-adjust stringunicode-range stringDefault:array()
function wp_print_font_faces( $fonts = array() ) {
if ( empty( $fonts ) ) {
$fonts = WP_Font_Face_Resolver::get_fonts_from_theme_json();
}
if ( empty( $fonts ) ) {
return;
}
$wp_font_face = new WP_Font_Face();
$wp_font_face->generate_and_print( $fonts );
}
| Version | Description |
|---|---|
| 6.4.0 | Introduced. |
You must log in before being able to contribute a note or feedback.
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_print_font_faces