显示文章、页面或其他任何内容类型的标题。
属性
通过 attributes 属性在 block.json 中定义。
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
level | number | 2 | — |
levelOptions | array | — | — |
isLink | boolean | false | 角色:content |
rel | string | "" | HTML 属性:rel。角色:content |
linkTarget | string | "_self" | 角色:content |
placeholder | string | — | — |
支持功能
通过 supports 属性在 block.json 中定义。
anchor:truealign:"wide","full"html:falsebackground:backgroundImage:truebackgroundSize:truegradient:true
color:dimensions:minHeight:trueminWidth:true
shadow:truespacing:margin:truepadding:true
typography:fontSize:truelineHeight:truetextAlign:true
interactivity:clientNavigation:true
上下文
通过 usesContext 和 providesContext 属性在 block.json 中定义。
使用的上下文:
postIdpostTypequeryId
块标记
这是一个 动态块。它在服务器上渲染,不会将 HTML 保存到文章内容中。
在文章内容中,它存储为块注释:
<!-- wp:post-title /-->
来源
- block.json (参考)
- 源代码目录 — 浏览
edit和save源文件、index.php等。