Created
May 11, 2011 05:19
-
-
Save mfields/965956 to your computer and use it in GitHub Desktop.
Wrap WordPress Enbeds in a div
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
<?php | |
/** | |
* Enclose embedded media in a div. | |
* | |
* Wrapping all flash embeds in a div allows for easier | |
* styling with CSS media queries. | |
* | |
* @todo Document parameters. | |
* | |
* @access private | |
* @since 1.0 | |
*/ | |
function _mfields_oembed_dataparse( $cache, $url, $attr = '', $post_ID = '' ) { | |
return '<div class="embed">' . $cache . '</div>'; | |
} | |
add_filter( 'embed_oembed_html', '_nighthawk_oembed_dataparse', 10, 4 ); | |
add_filter( 'embed_googlevideo', '_nighthawk_oembed_dataparse', 10, 2 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment