Created
April 20, 2016 21:14
-
-
Save simplethemes/d44b6b63babfa54cdf924d17f4904f7a to your computer and use it in GitHub Desktop.
Removes the YouTube dog shit from WordPress oEmbed
This file contains hidden or 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
function deuglify_youtube($embed) { | |
if (strstr($embed,'https://www.youtube.com/embed/')) { | |
return str_replace('?feature=oembed','?feature=oembed&autohide=1&rel=0&modestbranding=0&showinfo=0&enablejsapi=1',$embed); | |
} else { | |
return $embed; | |
} | |
} | |
add_filter('oembed_result', 'deuglify_youtube', 1, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment