スキーマ
スキーマはcategoryオブジェクトに存在するすべてのフィールドを定義しています。
id integer |
Unique identifier for the term. 読み取り専用 コンテキスト: |
count integer |
Number of published posts for the term. 読み取り専用 コンテキスト: |
description string |
HTML description of the term. コンテキスト: |
link string, uri |
URL of the term. 読み取り専用 コンテキスト: |
name string |
HTML title for the term. コンテキスト: |
slug string |
An alphanumeric identifier for the term unique to its type. コンテキスト: |
taxonomy string |
Type attribution for the term. 読み取り専用 コンテキスト: 次のいずれか: |
parent integer |
The parent term ID. コンテキスト: |
meta object |
Meta fields. コンテキスト: |
Example Request
$ curl -X OPTIONS -i http://demo.wp-api.org/wp-json/wp/v2/categories
Category一覧
引数
context |
Scope under which the request is made; determines fields present in response.
初期値: 次のいずれか: |
page |
Current page of the collection.
初期値: |
per_page |
Maximum number of items to be returned in result set.
初期値: |
search |
Limit results to those matching a string. |
exclude |
Ensure result set excludes specific IDs.
初期値: |
include |
Limit result set to specific IDs.
初期値: |
order |
Order sort attribute ascending or descending.
初期値: 次のいずれか: |
orderby |
Sort collection by term attribute.
初期値: 次のいずれか: |
hide_empty |
Whether to hide terms not assigned to any posts. |
parent |
Limit result set to terms assigned to a specific parent. |
post |
Limit result set to terms assigned to a specific post. |
slug |
Limit result set to terms with one or more specific slugs. |
定義
GET /wp/v2/categories
リクエスト例
$ curl http://demo.wp-api.org/wp-json/wp/v2/categories
Categoryを取得する
引数
id |
Unique identifier for the term. |
context |
Scope under which the request is made; determines fields present in response.
初期値: 次のいずれか: |
定義
GET /wp/v2/categories/<id>
リクエスト例
$ curl http://demo.wp-api.org/wp-json/wp/v2/categories/<id>
Categoryを作成
引数
description |
HTML description of the term. |
name |
HTML title for the term. 必須: true |
slug |
An alphanumeric identifier for the term unique to its type. |
parent |
The parent term ID. |
meta |
Meta fields. |
定義
POST /wp/v2/categories
Categoryを更新する
引数
id |
Unique identifier for the term. |
description |
HTML description of the term. |
name |
HTML title for the term. |
slug |
An alphanumeric identifier for the term unique to its type. |
parent |
The parent term ID. |
meta |
Meta fields. |
定義
POST /wp/v2/categories/<id>
リクエスト例
Categoryを削除
引数
id |
Unique identifier for the term. |
force |
Required to be true, as terms do not support trashing. |
定義
DELETE /wp/v2/categories/<id>
リクエスト例
$ curl -X DELETE http://demo.wp-api.org/wp-json/wp/v2/categories/<id>