Embed

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

This block is available in the latest version of WordPress and does not require the Gutenberg plugin.

Last updated

Category:

For developers

Block Grammar & Markup

<!-- 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 -->

Block Attributes

Optional. Type: Object.

Attributes provide the structured data needs of a block. They can exist in different forms when they are serialized, but they are declared together under a common interface.

Documentation

{
  "url": {
    "type": "string",
    "__experimentalRole": "content"
  },
  "caption": {
    "type": "rich-text",
    "source": "rich-text",
    "selector": "figcaption",
    "__experimentalRole": "content"
  },
  "type": {
    "type": "string",
    "__experimentalRole": "content"
  },
  "providerNameSlug": {
    "type": "string",
    "__experimentalRole": "content"
  },
  "allowResponsive": {
    "type": "boolean",
    "default": true
  },
  "responsive": {
    "type": "boolean",
    "default": false,
    "__experimentalRole": "content"
  },
  "previewable": {
    "type": "boolean",
    "default": true,
    "__experimentalRole": "content"
  }
}

Block Supports

Optional. Type: Object.

A set of options that enables or disables block controls in the editor, for example gradient colors or padding.

Documentation

{
  "align": true,
  "spacing": {
    "margin": true
  },
  "interactivity": {
    "clientNavigation": true
  }
}

Transforms

Optional. Type: Object.

Transforms provide rules for what a block can be transformed from and what it can be transformed to.

Documentation

Transforms from:

Transforms to: Paragraph.


View blocks per attribute or block support: