播放列表曲目。

  • 名称: core/playlist-track
  • 类别: 媒体
  • API 版本: 3
  • 块类型: 动态(服务器渲染)
  • 关键词: music, sound

块关系

父级 块(直接):
– core/playlist

属性

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

属性类型默认值描述
blobstring—角色: local
idnumber—角色: content
srcstring—角色: content
typestring"audio"—
albumstring—角色: content
artiststring—角色: content
imagestring—角色: content
imageAltstring—角色: content
lengthstring—角色: content
titlestring—角色: content

支持功能

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

上下文

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

使用的上下文:

  • showArtists
  • showImages

块标记

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

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

<!-- wp:core/playlist-track {"id":123,"src":"https://example.com/audio.mp3","album":"Example album","artist":"Example creator","image":"https://example.com/track-image.jpg","imageAlt":"Track image","length":"3:21","title":"Sample track"} /-->

来源