显示自定义日期。

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

属性

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

属性类型默认值描述
datetimestring—角色: content
formatstring——
isLinkbooleanfalse角色: content

支持功能

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

上下文

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

使用的上下文:

  • postId
  • postType
  • queryId

块标记

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

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

<!-- wp:post-date /-->

来源