-
Notifications
You must be signed in to change notification settings - Fork 844
Description
Impacted plugin
Jetpack
Quick summary
Ever since the if ( ! defined( 'REST_API_REQUEST' ) ) { line got added in youtube.php the wpcom_youtube_embed_crazy_url hander does not get registered anymore, causing the YouTube embed by Jetpack not to work. The default embed implemented by WordPress then gets executed instead.
Because the Jetpack embed code does not get added and executed, the embed in the final content does not get wrapped with the Jetpack embed-youtube span.
Steps to reproduce
Create a post and add a bare YouTube link to it on its own separate line. Bare YouTube links in the post content should get embedded after running the the_content filters and the video should be in an iframe surrounded by the <span> added by Jetpack.
Final result should look like this in the generated HTML:
<span class="embed-youtube" ... ><iframe ... ></iframe></span>
However, due to the bug it looks like:
<iframe ... ></iframe>
Site owner impact
More than 60% of the total website/platform users
Severity
Moderate
What other impact(s) does this issue have?
No response
If a workaround is available, please outline it here.
Workaround is to add the following in functions.php of the theme:
function wpcom_youtube_embed_crazy_url_init2() {
wp_embed_register_handler( 'wpcom_youtube_embed_crazy_url', '#https?://(?:www\.)?(?:youtube.com/(?:v/|playlist|watch[/\#?])|youtu\.be/).*#i', 'wpcom_youtube_embed_crazy_url' );
}
add_action( 'init', 'wpcom_youtube_embed_crazy_url_init2' );
Platform (Simple and/or Atomic)
Self-hosted
Metadata
Metadata
Assignees
Labels
Type
Projects
Status