Dropdown Menus Behind Embedded Videos

In some browser/platform combos the dropdown menu will be hidden behind embedded videos. Here is some code that will help that. It is only applicable to YouTube.

function add_wmode($html, $url, $attr) {

if (strstr($html,'http://www.youtube.com/embed/')) {
return str_replace('feature=oembed','feature=oembed&wmode=opaque',$html);
} else {

return $html;
}
}
add_filter('embed_oembed_html', 'add_wmode', 10, 3);

It is based on code from these websites:
http://mehigh.biz/wordpress/adding-wmode-transparent-to-wordpress-3-media-embeds.html
http://wordpress.org/support/topic/policing-youtube-embed-code-using-the-oembed-filter-hook
http://www.vsellis.com/code/fix-dropdown-menus-that-fall-behind-embeded-video/

Leave a Reply

Your email address will not be published. Required fields are marked *