Commit 3e734514 authored by John James Jacoby's avatar John James Jacoby

Only wrap full screenable embeds.

parent 89fe0feb
......@@ -59,7 +59,13 @@ add_filter( 'img_caption_shortcode', 'swifter_img_caption_shortcode', 10, 3 );
* @param string $html
* @return string
*/
function swifter_oembed_html( $html ) {
return '<div class="embed-responsive embed-responsive-16by9">' . $html . '</div>';
function swifter_oembed_html( $html, $url, $attr ) {
// Wrap in responsive div
if ( strstr( $html, 'allowfullscreen' ) ) {
$html = '<div class="embed-responsive embed-responsive-16by9">' . $html . '</div>';
}
return $html;
}
add_filter( 'embed_oembed_html', 'swifter_oembed_html', 10 );
add_filter( 'embed_oembed_html', 'swifter_oembed_html', 10, 3 );
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment