添加一个可下载文件的链接。
属性
通过 block.json 中的 attributes 属性定义。
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
id | number | — | — |
blob | string | — | 角色:local |
href | string | — | 角色:content |
fileId | string | — | 来源:attribute。 选择器:a:not([download])。 HTML 属性:id |
fileName | rich-text | — | 来源:rich-text。 选择器:a:not([download])。 角色:content |
textLinkHref | string | — | 来源:attribute。 选择器:a:not([download])。 HTML 属性:href。 角色:content |
textLinkTarget | string | — | 来源:attribute。 选择器:a:not([download])。 HTML 属性:target |
showDownloadButton | boolean | true | — |
downloadButtonText | rich-text | — | 来源:rich-text。 选择器:a[download]。 角色:content |
displayPreview | boolean | — | — |
previewHeight | number | 600 | — |
支持
通过 block.json 中的 supports 属性定义。
anchor:truealign:truebackground:backgroundImage:truebackgroundSize:truegradient:true
spacing:margin:truepadding:true
dimensions:minHeight:trueminWidth:true
color:shadow:trueinteractivity:true
块标记
这是一个 混合块。它保存静态标记,服务器在渲染期间可能会对其进行增强。
<!-- wp:file {"showDownloadButton":true,"previewHeight":600} -->
<!-- Content... -->
<!-- /wp:file -->
来源
- block.json (参考)
- 源代码目录 — 浏览
edit和save源文件、index.php等。