Themes
These routes allow you to retrieve data (settings) for themes. Added in WP 5.0.
Possible routes (endpoints described below):
/wp/v2/themes
Controller class: WP_REST_Themes_Controller{}
Contents:
Resource Schema
The schema shows all fields that exist for the object: the fields of the object that the request will return.
Parameter | Context | Description |
---|---|---|
stylesheet string readonly |
any | The theme's stylesheet, uniquely identifying the theme. |
template string readonly |
any | The theme template. For a child theme, this refers to the parent theme; otherwise, it matches the theme's stylesheet. |
author object readonly |
any | The theme author. |
author_uri object readonly |
any | The theme author's website. |
description object readonly |
any | The theme description. |
is_block_theme boolean readonly |
any | Whether the theme is block-based. |
name object readonly |
any | The theme name. |
requires_php string readonly |
any | The minimum PHP version required for the theme to function. |
requires_wp string readonly |
any | The minimum WordPress version required for the theme to function. |
screenshot string readonly |
any | The URL of the theme screenshot. |
tags object readonly |
any | Tags for the theme's styles and features. |
textdomain string readonly |
any | The theme's text domain. |
theme_supports object readonly |
any | Features supported by this theme. |
theme_uri object readonly |
any | The URL of the theme's page. |
version string readonly |
any | The current version of the theme. |
status string |
any | Named status for the theme. One of: inactive, active |
Route Description
An OPTIONS request to the route will return a full description of this route: endpoints, their parameters, schema.
$ curl -X OPTIONS -i http://demo.wp-api.org/wp-json/wp/v2/themesGitHub
Retrieving Theme Settings
Retrieves the specified settings of the theme.
Request Type
Access: authorization required
GET /wp-json/wp/v2/themes?status=active
Request Parameters
"context": { "required": false, "description": "Scope under which the request is made; determines fields present in response.", "type": "string" }, "page": { "required": false, "default": 1, "description": "Current page of the collection.", "type": "integer" }, "per_page": { "required": false, "default": 10, "description": "Maximum number of items to be returned in result set.", "type": "integer" }, "search": { "required": false, "description": "Limit results to those matching a string.", "type": "string" }, "status": { "required": true, "description": "Limit result set to themes assigned one or more statuses.", "type": "array", "items": { "enum": [ "active" ], "type": "string" } }
Example Request
$ curl http://example.com/wp-json/wp/v2/themes?status=active
Response:
[ { "theme_supports": { "formats": [ "standard", "aside", "image", "video", "quote", "link", "gallery", "status", "audio", "chat" ], "post-thumbnails": true, "responsive-embeds": true } } ]