Opened 2 years ago
Closed 6 months ago
#55963 closed defect (bug) (worksforme)
fontFace not in json schema
Reported by: | wprediscovered | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 6.0 |
Component: | Editor | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
I validate my theme.json
using the json schema, as recommended in the manual: https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/#developing-with-theme-json
I started using the recent fontFace
property to add my fonts via the theme.json
. Now the validation fails, because the current schema doesn't include the fontFace
property: https://schemas.wp.org/trunk/theme.json Neither does the Gutenberg schema: https://raw.githubusercontent.com/WordPress/gutenberg/trunk/schemas/json/theme.json
It seems the schema update was never part of the Gutenberg PR https://github.com/WordPress/gutenberg/pull/40493 and thus not of the Core backport: [53282]
An update to the json schema is needed to reflect the changed interface.
I created a temporary fix for my use case: https://git.fsfe.org/nico.rikken/fsfe-wordpress-theme/src/commit/f49937c6cca6211fbcc20782ff8c88877b948d76/theme-schema.json#L321-L353
As it is licensed GPL-2.0-or-later, it can be reused in upstream WordPress: https://git.fsfe.org/nico.rikken/fsfe-wordpress-theme/src/commit/f49937c6cca6211fbcc20782ff8c88877b948d76/theme-schema.json.license