Add a block that displays content pulled from other sites, like Twitter or YouTube.
Attributes
Defined via the attributes property in block.json.
| Attribute | Type | Default | Description |
|---|---|---|---|
url |
string |
— | Role: content |
caption |
rich-text |
— | Source: rich-text. Selector: figcaption. Role: content |
type |
string |
— | Role: content |
providerNameSlug |
string |
— | Role: content |
allowResponsive |
boolean |
true |
— |
responsive |
boolean |
false |
Role: content |
previewable |
boolean |
true |
Role: content |
Supports
Defined via the supports property in block.json.
anchor:truealign:truespacing:margin:true
interactivity:clientNavigation:true
Block Markup
This is a static block. The markup is saved directly in the post content.
<!-- 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">Embedded content from an example URL</figcaption>
</figure>
<!-- /wp:embed -->
Source
- block.json (reference)
- Source directory — browse
edit.js,save.js,index.php, and more.