Embed

In this article


Add a block that displays content pulled from other sites, like Twitter or YouTube.

  • Name: core/embed
  • Category: embed
  • API Version: 3
  • Block Type: Static (saved in post content)

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.

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