Skip to content

Instantly share code, notes, and snippets.

@davebonds
Created April 12, 2014 22:24
Show Gist options
  • Save davebonds/10559825 to your computer and use it in GitHub Desktop.
Save davebonds/10559825 to your computer and use it in GitHub Desktop.
function add_video_wmode_transparent($html, $url, $attr) {
if ( strpos( $html, "<embed src=" ) !== false )
{ return str_replace('</param><embed', '</param><param name="wmode" value="opaque"></param><embed wmode="opaque" ', $html); }
elseif ( strpos ( $html, 'feature=oembed' ) !== false )
{ return str_replace( 'feature=oembed', 'feature=oembed&wmode=opaque', $html ); }
else
{ return $html; }
}
add_filter( 'embed_oembed_html', 'add_video_wmode_transparent', 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment