WordPress中文开发手册

  1. Home
  2. Docs
  3. WordPress中文开发手册
  4. WordPress REST API手册
  5. 资源
  6. 文章类型

文章类型

Schema

The schema defines all the fields that exist for a type object.

capabilities

array
All capabilities used by the resource.

Read only

Context: edit

description

string
A human-readable description of the resource.

Read only

Context: view, edit

hierarchical

boolean
Whether or not the resource should have children.

Read only

Context: view, edit

labels

object
Human-readable labels for the resource for various contexts.

Read only

Context: edit

name

string
The title for the resource.

Read only

Context: view, edit, embed

slug

string
An alphanumeric identifier for the resource.

Read only

Context: view, edit, embed

Example Request #Example Request

$ curl -X OPTIONS -i http://demo.wp-api.org/wp-json/wp/v2/types

Top ↑

List Types #List Types

Top ↑

Arguments #Arguments

context

Scope under which the request is made; determines fields present in response.

Default: view

One of: view, embed, edit

Definition

GET /wp/v2/types

Example Request

$ curl http://demo.wp-api.org/wp-json/wp/v2/types

Retrieve a Type

Arguments

context

Scope under which the request is made; determines fields present in response.

Default: view

One of: view, embed, edit

Definition

GET /wp/v2/types/<type>

Example Request

$ curl http://demo.wp-api.org/wp-json/wp/v2/types/<type>