在全部页面的列表中显示一个页面。

  • 名称: core/page-list-item
  • 类别: 小部件
  • API 版本: 3
  • 块类型: 动态(服务器渲染)
  • 关键词: page, menu, navigation

块关系

父级块(直接):
– core/page-list

属性

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

属性类型默认值描述
idnumber——
labelstring——
titlestring——
linkstring——
hasChildrenboolean——

支持功能

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

上下文

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

使用的上下文:

  • textColor
  • customTextColor
  • backgroundColor
  • customBackgroundColor
  • overlayTextColor
  • customOverlayTextColor
  • overlayBackgroundColor
  • customOverlayBackgroundColor
  • fontSize
  • customFontSize
  • showSubmenuIcon
  • style
  • openSubmenusOnClick
  • submenuVisibility

块标记

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

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

<!-- wp:core/page-list-item {"id":"1","label":"Page","link":"https://example.com","hasChildren":"false"} /-->

来源