From 0cd98cb59ced5b9958327ad8b75249ce92120ae5 Mon Sep 17 00:00:00 2001 From: Matias Benedetto Date: Tue, 5 Dec 2023 11:03:14 -0600 Subject: [PATCH 1/4] Add preview key to theme.json schema --- schemas/json/theme.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index 782e59794a5d1..22e5fcb40fc26 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -623,6 +623,10 @@ "description": "CSS font-family value.", "type": "string" }, + "preview": { + "description": "URL to a preview image of the font family.", + "type": "string" + }, "fontFace": { "description": "Array of font-face declarations.", "type": "array", @@ -713,6 +717,10 @@ "unicodeRange": { "description": "CSS unicode-range value.", "type": "string" + }, + "preview": { + "description": "URL to a preview image of the font family.", + "type": "string" } }, "required": [ "fontFamily", "src" ], From fc58d5577880198857e159dc9da4f2155aea3717 Mon Sep 17 00:00:00 2001 From: Matias Benedetto Date: Tue, 5 Dec 2023 11:03:48 -0600 Subject: [PATCH 2/4] add preview key to php data sanitization schema --- lib/class-wp-theme-json-gutenberg.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/class-wp-theme-json-gutenberg.php b/lib/class-wp-theme-json-gutenberg.php index 9311001f2edd1..43a3772a1c3af 100644 --- a/lib/class-wp-theme-json-gutenberg.php +++ b/lib/class-wp-theme-json-gutenberg.php @@ -431,6 +431,7 @@ class WP_Theme_JSON_Gutenberg { 'fontFamily' => null, 'name' => null, 'slug' => null, + 'preview' => null, 'fontFace' => array( array( 'ascentOverride' => null, @@ -446,6 +447,7 @@ class WP_Theme_JSON_Gutenberg { 'sizeAdjust' => null, 'src' => null, 'unicodeRange' => null, + 'preview' => null, ), ), ), From e91a83a2751ff4c22b363c9f2edd0bdba8dec7c9 Mon Sep 17 00:00:00 2001 From: Matias Benedetto Date: Tue, 5 Dec 2023 15:37:53 -0600 Subject: [PATCH 3/4] update description text Co-authored-by: Jeff Ong --- schemas/json/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index 22e5fcb40fc26..10695f493c40d 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -719,7 +719,7 @@ "type": "string" }, "preview": { - "description": "URL to a preview image of the font family.", + "description": "URL to a preview image of the font face.", "type": "string" } }, From 2616cfc98b04439752950357d39d367631dc2433 Mon Sep 17 00:00:00 2001 From: Matias Benedetto Date: Tue, 5 Dec 2023 15:42:14 -0600 Subject: [PATCH 4/4] update docs --- docs/reference-guides/theme-json-reference/theme-json-living.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference-guides/theme-json-reference/theme-json-living.md b/docs/reference-guides/theme-json-reference/theme-json-living.md index 24a5845381bfd..627fee6071816 100644 --- a/docs/reference-guides/theme-json-reference/theme-json-living.md +++ b/docs/reference-guides/theme-json-reference/theme-json-living.md @@ -188,7 +188,7 @@ Settings related to typography. | textTransform | boolean | true | | | dropCap | boolean | true | | | fontSizes | array | | fluid, name, size, slug | -| fontFamilies | array | | fontFace, fontFamily, name, slug | +| fontFamilies | array | | fontFace, fontFamily, name, preview, slug | ---