Темы (themes)
Эти маршруты позволяют получить данные (настройки) темы. Добавлено в WP 5.0.
Возможные маршруты (конечные точки маршрутов описаны ниже):
/wp/v2/themes
Класс контроллера: WP_REST_Themes_Controller{}
Оглавление:
Схема ресурса
Описание маршрута
Запрос OPTIONS к маршруту вернет полное описание этого маршрута: эндпоинты их параметры, схему.
$ curl -X OPTIONS -i http://demo.wp-api.org/wp-json/wp/v2/themesGitHub
Получение настроек темы
Получает указанные настройки темы.
Вид запроса
Доступ: нужна авторизация
GET /wp-json/wp/v2/themes?status=active
Параметры запроса
"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" } }
Пример запроса
$ curl http://example.com/wp-json/wp/v2/themes?status=active
Ответ:
[ { "theme_supports": { "formats": [ "standard", "aside", "image", "video", "quote", "link", "gallery", "status", "audio", "chat" ], "post-thumbnails": true, "responsive-embeds": true } } ]