包含标题下方隐藏或显示的内容。
块关系
父级 块(直接):
– core/accordion-item
属性
通过 block.json 中的 attributes 属性定义。
支持功能
通过 block.json 中的 supports 属性定义。
html:falsebackground:backgroundImage:truebackgroundSize:truegradient:true
color:background:truegradients:truelink:trueheading:truebutton:true
interactivity:truespacing:padding:trueblockGap:true
typography:fontSize:truelineHeight:true
shadow:truelayout:allowEditing:false
visibility:falsecontentRole:trueallowedBlocks:truelock:false
上下文
通过 block.json 中的 usesContext 和 providesContext 属性定义。
使用的上下文:
core/accordion-open-by-default
块标记
这是一个 静态块。标记直接保存在帖子内容中。
<!-- wp:accordion-panel -->
<div role="region" class="wp-block-accordion-panel">
<!-- wp:paragraph -->
<p>Accordion Panel Content</p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:accordion-panel -->
来源
- block.json(参考)
- 源代码目录 — 浏览
edit和save源文件、index.php等。