Skip to content

Add Cover to Embed block transform for embedded video backgrounds#74244

Open
Mayank-Tripathi32 wants to merge 2 commits intoWordPress:trunkfrom
Mayank-Tripathi32:feat/try-add-cover-to-video-transform
Open

Add Cover to Embed block transform for embedded video backgrounds#74244
Mayank-Tripathi32 wants to merge 2 commits intoWordPress:trunkfrom
Mayank-Tripathi32:feat/try-add-cover-to-video-transform

Conversation

@Mayank-Tripathi32
Copy link
Copy Markdown
Member

#74210

What?

Adds support for transforming Cover blocks with embedded video backgrounds (YouTube, Vimeo, etc.) to the appropriate Embed block.

Why?

Follow-up to #73023 which added embedded video background support to Cover blocks. Currently, editors cannot easily convert a Cover block with an embedded video back to a standalone Embed block, limiting content portability and requiring manual recreation.

How?

  • Adds Cover → Embed block transform for blocks with EMBED_VIDEO_BACKGROUND_TYPE
  • Uses createUpgradedEmbedBlock utility to create the correct embed variation (YouTube, Vimeo, etc.)
  • Transform only available when Cover has embedded video URL (not regular video files)
  • Preserves URL and block attributes during transformation

Testing Instructions

  1. Create a Cover block
  2. Add media by pasting a YouTube URL (e.g., https://www.youtube.com/watch?v=dQw4w9WgXcQ)
  3. Click the block toolbar → Transform To
  4. Verify "Embed" appears as a transform option
  5. Select Embed transform
  6. Verify the block converts to a YouTube Embed block with the same URL
  7. Repeat with Vimeo URL to verify Vimeo embed transform

Screenshots

https://q7utzrengv.ufs.sh/f/Wgl9eBAmTj29gpWbqRxbvUVCLRtOZBc09F7pY3E1zdm6eXIS

@github-actions github-actions bot added the [Package] Block library /packages/block-library label Dec 28, 2025
@Mayank-Tripathi32 Mayank-Tripathi32 marked this pull request as ready for review December 28, 2025 19:13
@github-actions
Copy link
Copy Markdown

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: Mayank-Tripathi32 <mayanktripathi32@git.wordpress.org>

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

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Feature] Block Transforms Block transforms from one block to another labels Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Block Transforms Block transforms from one block to another [Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a “Transform to Video Block” option when transforming a Cover Block with an embed background

2 participants