架构
架构定义了块目录项记录中存在的所有字段。除非使用了 `_filter` 查询参数或该架构字段仅出现在特定上下文中,否则这些端点的任何响应都应包含以下字段。
name | 块名称,采用 namespace/block-name 格式。 JSON 数据类型:string 上下文: |
title | 块标题,采用人类可读格式。 JSON 数据类型:string 上下文: |
description | 块的简短描述,采用人类可读格式。 JSON 数据类型:string 上下文: |
id | 块标识符(slug)。 JSON 数据类型:string 上下文: |
rating | 块的星级评分。 JSON 数据类型:number 上下文: |
rating_count | 评分数量。 JSON 数据类型:integer 上下文: |
active_installs | 已激活此块的站点数量。 JSON 数据类型:integer 上下文: |
author_block_rating | 同一作者发布的块的平均评分。 JSON 数据类型:number 上下文: |
author_block_count | 同一作者发布的块的数量。 JSON 数据类型:integer 上下文: |
author | 块作者的 WordPress.org 用户名。 JSON 数据类型:string 上下文: |
icon | 块图标。 JSON 数据类型:string, 上下文: |
last_updated | 块最后更新的日期。 JSON 数据类型:string, 上下文: |
humanized_updated | 块最后更新的日期,采用模糊的人类可读格式。 JSON 数据类型:string 上下文: |
列出块目录项
查询此端点以检索块目录项集合。您可以使用以下 URL 查询参数来控制和管理接收到的响应。
定义
GET /wp/v2/block-directory/search
示例请求
$ curl https://example.com/wp-json/wp/v2/block-directory/search
参数
context | 请求的适用范围;决定响应中存在的字段。 默认值: 可选值: |
page | 当前页码。 默认值: |
per_page | 结果集中返回的最大项目数。 默认值: |
term | 将结果集限制为匹配搜索词的块。 必填:是 |