本文档介绍了 WordPress REST API 中状态(Statuses)的架构和端点。它定义了状态记录的字段,并提供了检索状态列表或单个状态的 API 方法。
GET /wp/v2/statuses
$ curl https://example.com/wp-json/wp/v2/statuses
GET /wp/v2/statuses/<status>
$ curl https://example.com/wp-json/wp/v2/statuses/<status>The schema defines all the fields that exist within a status record. Any response from these endpoints can be expected to contain the fields below unless the `_filter` query parameter is used or the schema field only appears in a specific context.
name
|
The title for the status.
JSON data type: string Read only Context: |
private
|
Whether posts with this status should be private.
JSON data type: boolean Read only Context: |
protected
|
Whether posts with this status should be protected.
JSON data type: boolean Read only Context: |
public
|
Whether posts of this status should be shown in the front end of the site.
JSON data type: boolean Read only Context: |
queryable
|
Whether posts with this status should be publicly-queryable.
JSON data type: boolean Read only Context: |
show_in_list
|
Whether to include posts in the edit listing for their post type.
JSON data type: boolean Read only Context: |
slug
|
An alphanumeric identifier for the status.
JSON data type: string Read only Context: |
date_floating
|
Whether posts of this status may have floating published dates.
JSON data type: boolean Read only Context: |
GET /wp/v2/statuses
Query this endpoint to retrieve a specific status record.
$ curl https://example.com/wp-json/wp/v2/statuses
context
|
Scope under which the request is made; determines fields present in response.
Default: One of: |
GET /wp/v2/statuses/<status>
Query this endpoint to retrieve a specific status record.
$ curl https://example.com/wp-json/wp/v2/statuses/<status>
status
|
An alphanumeric identifier for the status. |
context
|
Scope under which the request is made; determines fields present in response.
Default: One of: |