Gets fonts defined in style variations.
Source
public static function get_fonts_from_style_variations() {
$variations = WP_Theme_JSON_Resolver::get_style_variations();
$fonts = array();
if ( empty( $variations ) ) {
return $fonts;
}
foreach ( $variations as $variation ) {
if ( ! empty( $variation['settings']['typography']['fontFamilies']['theme'] ) ) {
$fonts = array_merge( $fonts, $variation['settings']['typography']['fontFamilies']['theme'] );
}
}
$settings = array(
'typography' => array(
'fontFamilies' => array(
'theme' => $fonts,
),
),
);
return static::parse_settings( $settings );
}
Changelog
Version | Description |
---|---|
6.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.