显示带有评论数量的标题。

  • 名称: core/comments-title
  • 类别: 主题
  • API 版本: 3
  • 块类型: 动态(服务器渲染)

块关系

祖先 块:
– core/comments

属性

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

属性类型默认值描述
showPostTitlebooleantrue—
showCommentsCountbooleantrue—
levelnumber2—
levelOptionsarray——

支持

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

上下文

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

使用的上下文:

  • postId
  • postType

块标记

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

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

<!-- wp:comments-title {"level":4,"style":{"spacing":{"padding":{"top":"6px","right":"6px","bottom":"6px","left":"6px"}},"border":{"width":"3px","radius":"100px"}},"borderColor":"vivid-red","backgroundColor":"primary","textColor":"background","fontSize":"large"} /-->

来源