mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 15:31:42 +01:00
Font face resolver: print font faces from font families defined in all theme.json origins.
This commit updates the theme.json style generation to allow a font family name to be repeated across theme.json origins (default, theme, custom). Props mmaattiiaass, hellofromtonya, arthur791004, ironprogrammer. Fixes #60605. Built from https://develop.svn.wordpress.org/trunk@57720 git-svn-id: http://core.svn.wordpress.org/trunk@57221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4fbb3d6975
commit
e88758878e
@ -13,13 +13,13 @@
|
|||||||
* @since 6.4.0
|
* @since 6.4.0
|
||||||
*
|
*
|
||||||
* @param array[][] $fonts {
|
* @param array[][] $fonts {
|
||||||
* Optional. The font-families and their font variations. Default empty array.
|
* Optional. The font-families and their font faces. Default empty array.
|
||||||
*
|
*
|
||||||
* @type string $font-family => array[] $variations {
|
* @type array {
|
||||||
* Optional. An associated array of font variations for this font-family.
|
* An indexed or associative (keyed by font-family) array of font variations for this font-family.
|
||||||
* Each variation has the following structure.
|
* Each font face has the following structure.
|
||||||
*
|
*
|
||||||
* @type array $font_variation {
|
* @type array {
|
||||||
* @type string $font-family The font-family property.
|
* @type string $font-family The font-family property.
|
||||||
* @type string|string[] $src The URL(s) to each resource containing the font data.
|
* @type string|string[] $src The URL(s) to each resource containing the font data.
|
||||||
* @type string $font-style Optional. The font-style property. Default 'normal'.
|
* @type string $font-style Optional. The font-style property. Default 'normal'.
|
||||||
|
@ -67,12 +67,7 @@ class WP_Font_Face_Resolver {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare the fonts array structure for this font-family.
|
$fonts[] = static::convert_font_face_properties( $definition['fontFace'], $font_family_name );
|
||||||
if ( ! array_key_exists( $font_family_name, $fonts ) ) {
|
|
||||||
$fonts[ $font_family_name ] = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
$fonts[ $font_family_name ] = static::convert_font_face_properties( $definition['fontFace'], $font_family_name );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.5-beta2-57719';
|
$wp_version = '6.5-beta2-57720';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user