Skip to content

Embed block: Add example preview#71014

Closed
Infinite-Null wants to merge 1 commit intoWordPress:trunkfrom
Infinite-Null:feature/embed-block-example
Closed

Embed block: Add example preview#71014
Infinite-Null wants to merge 1 commit intoWordPress:trunkfrom
Infinite-Null:feature/embed-block-example

Conversation

@Infinite-Null
Copy link
Contributor

Part of #64707

What?

This PR adds an example attribute to the Embed block to provide a block preview in the inserter.

Testing Instructions

  1. Open a post or page in the WordPress block editor.
  2. Open the block inserter by clicking the "+" button.
  3. Search for "embed" in the block inserter.
  4. Hover over the Embed block in the inserter to see the preview.

Screenshots

Before After
Screenshot 2025-08-01 at 2 24 44 PM Screenshot 2025-08-01 at 2 23 42 PM

@github-actions
Copy link

github-actions bot commented Aug 1, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Infinite-Null <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@yogeshbhutkar yogeshbhutkar added [Type] Enhancement A suggestion for improvement. [Block] Embed Affects the Embed Block labels Aug 1, 2025
Copy link
Contributor

@yogeshbhutkar yogeshbhutkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, "Block Preview" works by giving an impression of how the block might look on the front-end. One can derive this by observing the example preview of other blocks.

Since the placeholder isn't rendered on the front-end at all, I believe it's probably better for the embed blocks to show "No preview available" instead of showing the placeholders as a preview (until we're able to show the actual previews of embeds for all the variations). However, I'd prefer to get a second review from someone more knowledgeable.

Also, please note that this change will apply to all the corresponding block variations.

Image

@Infinite-Null
Copy link
Contributor Author

Got it, Thank you for the clarification @yogeshbhutkar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Embed Affects the Embed Block [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants