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{}

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/themes
GitHub
{
    "namespace": "wp/v2",
    "methods": [
        "GET"
    ],
    "endpoints": [
        {
            "methods": [
                "GET"
            ],
            "args": {
                "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"
                    }
                }
            }
        }
    ],
    "schema": {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "title": "theme",
        "type": "object",
        "properties": {
            "theme_supports": {
                "description": "Features supported by this theme.",
                "type": "array",
                "readonly": true,
                "properties": {
                    "formats": {
                        "description": "Post formats supported.",
                        "type": "array",
                        "readonly": true
                    },
                    "post-thumbnails": {
                        "description": "Whether the theme supports post thumbnails.",
                        "type": [
                            "array",
                            "bool"
                        ],
                        "readonly": true
                    },
                    "responsive-embeds": {
                        "description": "Whether the theme supports responsive embedded content.",
                        "type": "bool",
                        "readonly": true
                    }
                }
            }
        }
    },
    "_links": {
        "self": "https://demo.wp-api.org/wp-json/wp/v2/themes"
    }
}

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
		}
	}
]