添加一个显示从其他网站(如 Twitter 或 YouTube)拉取内容的块。
属性
通过 attributes 属性在 block.json 中定义。
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
url | string | — | 角色:content |
caption | rich-text | — | 来源:rich-text。 选择器:figcaption。 角色:content |
type | string | — | 角色:content |
providerNameSlug | string | — | 角色:content |
allowResponsive | boolean | true | — |
responsive | boolean | false | 角色:content |
previewable | boolean | true | 角色:content |
支持
通过 supports 属性在 block.json 中定义。
anchor:truealign:truedimensions:minHeight:trueminWidth:true
spacing:margin:truepadding:true
interactivity:clientNavigation:true
块标记
这是一个 静态块。标记直接保存在文章内容中。
<!-- wp:embed {"url":"https://example.com/"} -->
<figure class="wp-block-embed">
<div class="wp-block-embed__wrapper">
https://example.com/
</div>
<figcaption class="wp-element-caption">来自示例 URL 的嵌入内容</figcaption>
</figure>
<!-- /wp:embed -->
来源
- block.json (参考)
- 源目录 — 浏览
edit和save源文件、index.php等。