Forked from wwdboer/WordPress Bootstrap responsive embed
Created
May 17, 2017 04:30
-
-
Save jeweltheme/e16ccb6d6c268aaca932aeef3c24e5d6 to your computer and use it in GitHub Desktop.
WordPress Bootstrap responsive embed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Wrap embed html with bootstrap responsive embed div | |
*/ | |
function bootstrap_embed( $html, $url, $attr ) { | |
if ( ! is_admin() ) { | |
return "<div class=\"embed-responsive embed-responsive-16by9\">" . $html . "</div>"; | |
} else { | |
return $html; | |
} | |
} | |
add_filter( 'embed_oembed_html', 'bootstrap_embed', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment