Make WordPress Core

Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#51566 closed defect (bug) (fixed)

Process embeds for block widgets

Reported by: talldanwp's profile talldanwp Owned by: noisysocks's profile noisysocks
Milestone: 5.8 Priority: normal
Severity: normal Version:
Component: Embeds Keywords: has-patch needs-dev-note
Focuses: Cc:


As noticed in a Gutenberg issue (, embeds made using the embed block are not showing on the front end.

From what I understand, the class WP_Embed is responsible for processing embeds in content.

Currently it runs on the_content (post content) and widget_text_content (text widgets), but not on other types of widget:

To solve the bug, I think we'd want it to also run for all block based widgets.

Attachments (1)

51566.diff (3.0 KB) - added by noisysocks 3 years ago.

Download all attachments as: .zip

Change History (12)

#1 @talldanwp
4 years ago

  • Milestone changed from Awaiting Review to 5.6

#2 @talldanwp
4 years ago

I think this is currently blocked awaiting (trac ticket -, which adds the WP_Widget_Block class to core from the gutenberg repository.

Once that's in place a filter could be added to that block widget, and then the same technique used to process embeds.

I haven't worked on core embed code before, so if I'm wrong in any of these assumptions, let me know :)

#3 @talldanwp
4 years ago

  • Milestone changed from 5.6 to 5.7

Bumping to 5.7 along with other widget related changes.

#4 @hellofromTonya
3 years ago

  • Milestone changed from 5.7 to 5.8

This ticket is blocked by #51506 as noted above. 51506 was moved to 5.8 as widgets in core are targeted for 5.8, not 5.7. Moving this ticket with it.

This ticket was mentioned in Slack in #core by chaion07. View the logs.

3 years ago

#6 @chaion07
3 years ago

We reviewed this ticket during a recent [5.8 bug-scrub] Since #51506 isn't a blocker anymore we feel the need of a patch Requesting a much needed attention from contributors. Thank you!

#7 @talldanwp
3 years ago

Just gave this a test now that block-based widgets have landed in core, and it looks like as well as the code quality improvement in this PR there's also an issue in the customizer where responsive embed don't display in the editor.

3 years ago

#8 @noisysocks
3 years ago

  • Keywords has-patch added; needs-patch removed

51566.diff adds a new widget_block_content filter which works the same way as widget_text_content.

#9 @noisysocks
3 years ago

  • Owner set to noisysocks
  • Resolution set to fixed
  • Status changed from new to closed

In 51058:

Widget block: Add widget_block_content filter

Adds a new 'widget_block_content' filter to the widget block and hooks
run_shortcode, autoembed, do_blocks, and do_shortcode into it by
default. This is simlar to widget_text_content.

Fixes #51566.
Props talldanwp.

#10 @SergeyBiryukov
3 years ago

In 51063:

Docs: Correct type for the $widget parameter of the widget_block_content filter.

Follow-up to [51058].

See #51566.

#11 @milana_cap
3 years ago

  • Keywords needs-dev-note added
Note: See TracTickets for help on using tickets.