Make WordPress Core

Opened 8 years ago

Last modified 7 years ago

#46457 new defect (bug)

Embed Block to a Reusable Block

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

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
8 years 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
8 years 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.


8 years ago

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


7 years ago
#4

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
7 years 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.