Make WordPress Core

Opened 7 months ago

Last modified 7 months ago

#48034 new defect (bug)

Video embeds fail if embed block is converted to a reusable block.

Reported by: donmhico Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Embeds Keywords: has-patch
Focuses: Cc:


This issue is from Gutenberg's GitHub repo -

I'll just copy the main issue here - https://github.com/WordPress/gutenberg/issues/4483

Credits to niranjan-uma-shankar for raising the issue.

Embedding youtube videos works well. However, if you convert the block to a reusable block, the youtube player no longer gets embedded in the post. In the editor, the embed continues to show the player, though the play button doesn't work anymore.

Attachments (1)

48034.diff (575 bytes) - added by donmhico 7 months ago.

Download all attachments as: .zip

Change History (2)

7 months ago

#1 @donmhico
7 months ago

  • Keywords has-patch added

The issue seems to be caused by the mis-order of when re-usable blocks are parsed.
<!-- wp:block {"ref":XXX} /--> - which handles reusable blocks are parsed during do_block(). But at this time the filter that gets the autoembed meta is already finished and will no longer be called.


The solution in the attached patch, 48034.diff, is to invoke do_block() earlier so that <!-- wp:block {"ref":XXX} /--> is already converted to the actual block content before it is passed to the autoembed filter.

I'm not entirely sure though if this will cause any backward compatibility issue. Feedback and more tests are highly appreciated.

Note: See TracTickets for help on using tickets.