Created
September 25, 2012 07:30
-
-
Save jasontucker/3780458 to your computer and use it in GitHub Desktop.
filter oembed for wmode transparent youtube video
This file contains 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 | |
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