Skip to content

Instantly share code, notes, and snippets.

@mfields
Created May 11, 2011 05:19
Show Gist options
  • Save mfields/965956 to your computer and use it in GitHub Desktop.
Save mfields/965956 to your computer and use it in GitHub Desktop.
Wrap WordPress Enbeds in a div
<?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