隐藏和显示额外内容。
属性
通过 attributes 属性在 block.json 中定义。
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
showContent | boolean | false | — |
summary | rich-text | — | 来源: rich-text。 选择器: summary。 角色: content |
name | string | — | 来源: attribute。 选择器: .wp-block-details。 HTML 属性: name |
placeholder | string | — | — |
支持
通过 supports 属性在 block.json 中定义。
align:"wide","full"anchor:truebackground:backgroundImage:truebackgroundSize:truegradient:true
color:html:falseshadow:truespacing:margin:truepadding:trueblockGap:true
dimensions:minWidth:true
typography:fontSize:truelineHeight:true
layout:allowEditing:false
interactivity:clientNavigation:true
allowedBlocks:true
块标记
这是一个 混合块。它保存静态标记,服务器在渲染期间可能会对其进行增强。
<!-- wp:details {"summary":"Details Summary"} -->
<details class="wp-block-details"><summary>Details Summary</summary>
<!-- wp:paragraph {"placeholder":"Type / to add a hidden block"} -->
<p>Details Content</p>
<!-- /wp:paragraph -->
</details>
<!-- /wp:details -->
来源
- block.json (参考)
- 源代码目录 — 浏览
edit和save源文件,index.php等。