`/wp/v2/template-parts`

Namespace: wp/v2
Route: /wp/v2/template-parts

Routes

  • Collection: /wp/v2/template-parts
  • Single: /wp/v2/template-parts/{id}

HTTP Methods

Collection methods: Unknown

Single methods: GET, POST

Request Parameters

Single GET

ParameterTypeRequiredDefaultDescription
idstringfalseThe id of a template
contextstringfalseviewScope under which the request is made; determines fields present in response.

Single POST

ParameterTypeRequiredDefaultDescription
idstringfalseThe id of a template
slugstringfalseUnique slug identifying the template.
themestringfalseTheme identifier for the template.
typestringfalseType of template.
contentobject, stringfalseContent of template.
titleobject, stringfalseTitle of template.
descriptionstringfalseDescription of template.
statusstringfalseStatus of template.
authorintegerfalseThe ID for the author of the template.
areastringfalseWhere the template part is intended for use (header, footer, etc.)

Response Schema (Item)

Schema not available.

Authentication

  • Read/Write: edit_theme_options.

Example Requests

bash
curl -X GET "https://wordpress.org/news/wp-json/wp/v2/template-parts"
bash
curl -X GET "https://wordpress.org/news/wp-json/wp/v2/template-parts/twentytwentyfour//header"

Example Response (trimmed)

json
{
  "id": 1,
  "_links": {
    "self": [{ "href": "/wp/v2/template-parts/1" }]
  }
}