Schema
The schema defines all the fields that exist for a category object.
idinteger |
Unique identifier for the term. Read only Context: |
countinteger |
Number of published posts for the term. Read only Context: |
descriptionstring |
HTML description of the term. Context: |
linkstring, uri |
URL of the term. Read only Context: |
namestring |
HTML title for the term. Context: |
slugstring |
An alphanumeric identifier for the term unique to its type. Context: |
taxonomystring |
Type attribution for the term. Read only Context: One of: |
parentinteger |
The parent term ID. Context: |
metaobject |
Meta fields. Context: |
Example Request
$ curl -X OPTIONS -i http://demo.wp-api.org/wp-json/wp/v2/categories
List Categorys
Arguments
context |
Scope under which the request is made; determines fields present in response.
Default: One of: |
page |
Current page of the collection.
Default: |
per_page |
Maximum number of items to be returned in result set.
Default: |
search |
Limit results to those matching a string. |
exclude |
Ensure result set excludes specific IDs.
Default: |
include |
Limit result set to specific IDs.
Default: |
order |
Order sort attribute ascending or descending.
Default: One of: |
orderby |
Sort collection by term attribute.
Default: One of: |
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 a specific slug. |
Definition
GET /wp/v2/categories
Example Request
$ curl http://demo.wp-api.org/wp-json/wp/v2/categories
Retrieve a Category
Arguments
context |
Scope under which the request is made; determines fields present in response.
Default: One of: |
Definition
GET /wp/v2/categories/<id>
Example Request
$ curl http://demo.wp-api.org/wp-json/wp/v2/categories/<id>
Create a Category
Arguments
description |
HTML description of the term. |
name |
HTML title for the term. Required: true |
slug |
An alphanumeric identifier for the term unique to its type. |
parent |
The parent term ID. |
meta |
Meta fields. |
Definition
POST /wp/v2/categories
Update a Category
Arguments
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. |
Definition
POST /wp/v2/categories/<id>
Example Request
Delete a Category
Arguments
force |
Required to be true, as terms do not support trashing. |
Definition
DELETE /wp/v2/categories/<id>
Example Request
$ curl -X DELETE http://demo.wp-api.org/wp-json/wp/v2/categories/<id>