显示给定分类法的所有术语列表。

  • 名称: core/categories
  • 类别: widgets
  • API 版本: 3
  • 块类型: Dynamic(服务器渲染)
  • 关键词: categories

属性

通过块.json 中的 attributes 属性定义。

属性类型默认值描述
taxonomystring"category"—
displayAsDropdownbooleanfalse—
showHierarchybooleanfalse—
showPostCountsbooleanfalse—
showOnlyTopLevelbooleanfalse—
showEmptybooleanfalse—
labelstring—角色: content
showLabelbooleantrue—

支持

通过块.json 中的 supports 属性定义。

上下文

通过块.json 中的 usesContext 和 providesContext 属性定义。

使用的上下文:

  • enhancedPagination

块标记

这是一个 动态块。它在服务器上渲染,不会在帖子内容中保存 HTML。

在帖子内容中,它存储为块注释:

<!-- wp:core/categories {"showPostCounts":false,"displayAsDropdown":false,"showHierarchy":false} /-->

来源