embed-privacy
embed-privacy copied to clipboard
Broken aspect ratio and stripped attributes with DIVI
Bug/Problem
The initial aspect ratio is not used if Embed Privacy is active in the DIVI theme/builder. This is true even if the builder is not used, but the theme is active.
Steps to reproduce
- Use DIVI
- Embed a YouTube video
- Install Embed Privacy
- See the blocked video with wrong aspect ratio, click it to load it.
- See the even more wrong aspect ratio
Additionally the related video are broken. Used this snippet to change them in DIVI:
if ( ! function_exists( 'dbvideo_html_without_youtube_related_videos' ) ) {
function dbvideo_html_without_youtube_related_videos( $old_content ) {
$regex = preg_quote( 'https://www.youtube.com/embed/', '/' ) . '[a-z0-9_-]+' . preg_quote( '?feature=oembed', '/' );
$new_content = preg_replace_callback( "/$regex/i", 'dbvideo_url_without_youtube_related_videos', $old_content );
return apply_filters( 'dbvideo_html_without_youtube_related_videos', $new_content, $old_content );
}
}
if ( ! function_exists( 'dbvideo_url_without_youtube_related_videos' ) ) {
function dbvideo_url_without_youtube_related_videos( $match ) {
$old_url = isset( $match[0] ) ? $match[0] : '';
$new_url = add_query_arg( 'rel', '0', $old_url );
return apply_filters( 'dbvideo_url_without_youtube_related_videos', $new_url, $match );
}
}
add_action( 'the_content', 'dbvideo_html_without_youtube_related_videos', 100 );
Version
1.8.1
Link
https://singingsues.de/2020/08/04/corona-chor-mosaik-million-dreams/
Environment info
WordPress 6.4.3 Embed Privacy 1.8.1 DIVI 4.24.2
Code of Conduct
- [X] I agree to follow this project's Code of Conduct