Last active
August 29, 2015 13:57
-
-
Save flowdee/9504587 to your computer and use it in GitHub Desktop.
Removes the closing bracket at the end of WordPress' oEmbed using YouTube.
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 remove_youtube_parenthesis ($html, $url ) { | |
if ( preg_match('#https?://(www\.)?youtu#i', $url) ) { | |
$html = preg_replace('/\)$/', '', $html); | |
} | |
return $html; | |
} | |
add_filter( 'oembed_result', 'remove_youtube_parenthesis ', 10, 2 ); | |
add_filter( 'embed_oembed_html', 'remove_youtube_parenthesis ', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yea updated it! thanks