Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#52005 closed defect (bug) (invalid)

Custom Embed Handlers not rendering preview in "Embed" Block

Reported by: madtownlems's profile MadtownLems Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.6
Component: Embeds Keywords:
Focuses: Cc:


I have a custom embed handler, registered with wp_embed_register_handler - as the site does not support oEmbed. We've used it for a decade without issue, but are now looking to move to the Block Editor.

When I insert a video's URL into an Embed block, it displays "Sorry, this content could not be embedded."

However, when I view the post, the video is embedded properly.

The ideal behavior would be the block showing a preview of the embedded video, much like if the site supported oEmbed.

Next-best behavior might be some more generic preview, perhaps a large "play" button and some text that says "Embedded video."

But the current situation is very rough from a user perspective. The UI is telling me "This content could not be embedded" - when it absolutely can be. One need only view the post to see it embedded.

It looks like the Embed block only tries to use oEmbed, and ignores any custom handlers, when determining if the content could be embedded.

Change History (3)

#1 @MadtownLems
4 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Before anyone spends time on this, I believe this is user error. I'm going to mark my own ticket as invalid while I confirm. My apologies.

#2 @MadtownLems
4 years ago

  • Keywords close added

I have confirmed this report to be invalid.

If anyone stumbles here and wonders why your custom embed handlers are embedding properly on the front-end but not the back-end, ensure that your calls to wp_embed_register_handler are attached to a hook that actually runs on the back-end (such as plugins_loaded), and not a front-end only hook

#3 @desrosj
3 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.