WordPress.org

Make WordPress Core

Opened 21 months ago

Last modified 8 months ago

#46457 new defect (bug)

Embed Block to a Reusable Block

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

Description

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
20 months ago

I found the PRs where we fixed this in the Gutenberg plugin, before the code was removed and migrated over to core.

https://github.com/WordPress/gutenberg/pull/10035 changed the filter priorities so that do_blocks ran before oembed, but it had unintendend consequences for autop. https://github.com/WordPress/gutenberg/pull/11050 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
20 months ago

I've written a new e2e test for Gutenberg which covers this case, it's at https://github.com/WordPress/gutenberg/pull/14663 if it helps test here.

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


20 months ago

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


8 months 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: https://core.trac.wordpress.org/ticket/46457

#5 @earnjam
8 months ago

It is passing all the tests in Gutenberg too: https://github.com/WordPress/gutenberg/pull/21043

Note: See TracTickets for help on using tickets.