架构

架构定义了块目录项记录中存在的所有字段。除非使用了 `_filter` 查询参数或该架构字段仅出现在特定上下文中,否则这些端点的任何响应都应包含以下字段。

name 块名称,采用 namespace/block-name 格式。

JSON 数据类型:string

上下文:view

title 块标题,采用人类可读格式。

JSON 数据类型:string

上下文:view

description 块的简短描述,采用人类可读格式。

JSON 数据类型:string

上下文:view

id 块标识符(slug)。

JSON 数据类型:string

上下文:view

rating 块的星级评分。

JSON 数据类型:number

上下文:view

rating_count 评分数量。

JSON 数据类型:integer

上下文:view

active_installs 已激活此块的站点数量。

JSON 数据类型:integer

上下文:view

author_block_rating 同一作者发布的块的平均评分。

JSON 数据类型:number

上下文:view

author_block_count 同一作者发布的块的数量。

JSON 数据类型:integer

上下文:view

author 块作者的 WordPress.org 用户名。

JSON 数据类型:string

上下文:view

icon 块图标。

JSON 数据类型:string,
格式:uri

上下文:view

last_updated 块最后更新的日期。

JSON 数据类型:string,
格式:datetime (详细信息)

上下文:view

humanized_updated 块最后更新的日期,采用模糊的人类可读格式。

JSON 数据类型:string

上下文:view

列出块目录项

查询此端点以检索块目录项集合。您可以使用以下 URL 查询参数来控制和管理接收到的响应。

定义

GET /wp/v2/block-directory/search

示例请求

$ curl https://example.com/wp-json/wp/v2/block-directory/search

参数

context 请求的适用范围;决定响应中存在的字段。

默认值:view

可选值:view

page 当前页码。

默认值:1

per_page 结果集中返回的最大项目数。

默认值:10

term 将结果集限制为匹配搜索词的块。

必填:是