Skip to content

Instantly share code, notes, and snippets.

@jasontucker
Created September 25, 2012 07:30
Show Gist options
  • Save jasontucker/3780458 to your computer and use it in GitHub Desktop.
Save jasontucker/3780458 to your computer and use it in GitHub Desktop.
filter oembed for wmode transparent youtube video
<?php
function add_video_wmode_transparent($html, $url, $attr) {
if (strpos($html, "<embed src=" ) !== false) {
$html = str_replace('</param><embed', '</param><param name="wmode" value="transparent"></param><embed wmode="transparent" ', $html);
return $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