Created
January 15, 2015 10:32
-
-
Save wwdboer/643e7cdec902131d8c8e to your computer and use it in GitHub Desktop.
WordPress Bootstrap responsive embed
This file contains 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