Opened 6 years ago
Last modified 5 years ago
#46457 new defect (bug)
Embed Block to a Reusable Block
Reported by: |
|
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)
#2
@
6 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.
6 years ago
This ticket was mentioned in PR #192 on WordPress/wordpress-develop by earnjam.
5 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
@
5 years ago
It is passing all the tests in Gutenberg too: https://github.com/WordPress/gutenberg/pull/21043
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 beforeoembed
, but it had unintendend consequences forautop
. 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?