<?php | |
/** | |
* oEmbed Transparency | |
* | |
* Used so that menus can appear on top of videos | |
* | |
* @author Bill Erickson | |
* @link http://www.billerickson.net/code/oembed-transparency | |
* | |
* @param string $html | |
* @param string $url | |
* @param array $attr, shortcode attributes | |
* @param int $post_id | |
* @return string The embed HTML on success, otherwise the original URL. | |
*/ | |
function be_oembed_transparency( $html, $url, $attr, $post_id ) { | |
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', 'be_oembed_transparency', 10, 4 ); |
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