REST API 文档

区块模式分类

💡 云策文档标注

概述

本文档介绍了 WordPress 区块模式分类的 Schema 定义和 API 端点,用于管理和检索区块模式分类记录。

关键要点

  • Schema 定义了区块模式分类记录的字段,包括 name、label 和 description,这些字段在 view、edit 和 embed 上下文中为只读。
  • 提供了 GET /wp/v2/block-patterns/categories 端点来检索区块模式分类记录,该端点无需参数。

代码示例

GET /wp/v2/block-patterns/categories
$ curl https://example.com/wp-json/wp/v2/block-patterns/categories

📄 原文内容

Schema

The schema defines all the fields that exist within a block pattern category 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 category name.

JSON data type: string

Read only

Context: view, edit, embed

label The category label, in human readable format.

JSON data type: string

Read only

Context: view, edit, embed

description The category description, in human readable format.

JSON data type: string

Read only

Context: view, edit, embed

Retrieve a Block Pattern Category

Definition & Example Request

GET /wp/v2/block-patterns/categories

Query this endpoint to retrieve a specific block pattern category record.

$ curl https://example.com/wp-json/wp/v2/block-patterns/categories

There are no arguments for this endpoint.