_wp_theme_json_webfonts_handler ( No parameters )


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.

Related Functions

_json_wp_die_handler, _jsonp_wp_die_handler, wp_clean_theme_json_cache, wp_media_upload_handler, wp_embed_unregister_handler

Top Google Results

User discussions

wpseek mobile