Make WordPress Core

Opened 3 years ago

Last modified 2 years ago

#46457 new defect (bug)

Embed Block to a Reusable Block

Reported by: ryoraspp's profile ryoraspp Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.1
Component: General Keywords:
Focuses: Cc:


If I add an Embed Block to a Reusable Block, only the URL is output.

Add on functions.php

global $wp_embed;
add_filter( 'the_content', array( $wp_embed, 'autoembed' ), 9

Change History (5)

#1 @notnownikki
3 years ago

I found the PRs where we fixed this in the Gutenberg plugin, before the code was removed and migrated over to core. changed the filter priorities so that do_blocks ran before oembed, but it had unintendend consequences for autop. fixed those issues.

It seems like altering the priorities in core in the same way as PR10035 did does not break any tests, so I'm not confident I can fix these without breaking things unintentionally. Who would be best to ask about this one?

#2 @notnownikki
3 years ago

I've written a new e2e test for Gutenberg which covers this case, it's at if it helps test here.

This ticket was mentioned in Slack in #core-editor by notnownikki. View the logs.

3 years ago

This ticket was mentioned in PR #192 on WordPress/wordpress-develop by earnjam.

2 years ago

This changes the order of two filters on the_content. It moves do_blocks up and moves WP_Embed->autoembed() later.

It solves the issue of auto-embed blocks that have been converted to reusable blocks not being rendered on the front-end of a site and instead just showing the URL.

It feels risky, but from what I can tell the tests are passing both here and in Gutenberg when trying this.

Trac ticket:

#5 @earnjam
2 years ago

It is passing all the tests in Gutenberg too:

Note: See TracTickets for help on using tickets.