Fonts
These routes let you manage theme font families and faces, and retrieve font collections.
Available routes (endpoints are described below):
/wp/v2/font-families
/wp/v2/font-families/{id}
/wp/v2/font-families/{id}/font-faces
/wp/v2/font-collections
Controller classes:
- WP_REST_Font_Families_Controller{}
- WP_REST_Font_Faces_Controller{}
- WP_REST_Font_Collections_Controller{}
Contents:
Resource schema
The schema lists fields returned by the resource. Fields depend on the context and user capabilities.
| Field | Context | Description |
|---|---|---|
| id | view, edit |
Resource field. |
| slug | view, edit |
Resource field. |
| name | view, edit |
Resource field. |
| font_family_settings | view, edit |
Resource field. |
| font_face_settings | view, edit |
Resource field. |
| src | view, edit |
Resource field. |
| font_weight | view, edit |
Resource field. |
| font_style | view, edit |
Resource field. |
/wp/v2/font-families
An OPTIONS request returns methods, parameters, and the complete schema for the selected route.
$ curl -X OPTIONS -i https://example.com/wp-json/wp/v2/font-families
Get data
Request type
GET /wp/v2/font-families
Request parameters
- $context(string)
- Response context:
view,embed, oredit. - $page(integer)
- Collection page number.
- $per_page(integer)
- Number of items per page.
Request example
$ curl https://example.com/wp-json/wp/v2/font-families
Create, update, and delete
Request type
POST /wp/v2/font-families
POST /wp/v2/font-families/{id}
DELETE /wp/v2/font-families/{id}
Request parameters
- $id(string)
- Resource field value.
- $slug(string)
- Resource field value.
- $name(string)
- Resource field value.
- $font_family_settings(string)
- Resource field value.
Request example
$ curl -X POST https://example.com/wp-json/wp/v2/font-families -d status=publish