_wp_theme_json_webfonts_handler
- %1$s is private and should not be used in themes or plugins directly.
_wp_theme_json_webfonts_handler ( No parameters )
- Introduced in WordPress: 6.0.0
- Deprecated in WordPress: —
Description
Runs the theme.json webfonts handler.Using `WP_Theme_JSON_Resolver`, it gets the fonts defined
in the `theme.json` for the current selection and style
variations, validates the font-face properties, generates
the '@font-face' style declarations, and then enqueues the
styles for both the editor and front-end.
Design Notes:
This is not a public API, but rather an internal handler.
A future public Webfonts API will replace this stopgap code.
This code design is intentional.
a. It hides the inner-workings.
b. It does not expose API ins or outs for consumption.
c. It only works with a theme's `theme.json`.
Why?
a. To avoid backwards-compatibility issues when
the Webfonts API is introduced in Core.
b. To make `fontFace` declarations in `theme.json` work.