该区块是实验性的,可能会在没有通知的情况下更改或被移除。

使用标题列表总结您的帖子。向标题区块添加 HTML 锚点以在此处链接它们。

  • 名称: core/table-of-contents
  • 类别: design
  • API 版本: 3
  • 区块类型: Dynamic (server-rendered)
  • 关键词: document outline, summary

属性

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

属性类型默认描述
headingsarray[]角色: local
onlyIncludeCurrentPagebooleanfalse—
maxLevelnumber——
orderedbooleantrue—

支持

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

区块标记

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

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

<!-- wp:table-of-contents {"maxLevel":3,"ordered":false} /-->

来源