Created
June 21, 2016 19:13
-
-
Save macbookandrew/2646426895d88d1e7e06affd627bd178 to your computer and use it in GitHub Desktop.
Prevent YouTube embedded videos from showing related videos at the end
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
/* Prevent YouTube Related Content on oEmbed-ed videos */ | |
add_filter( 'oembed_result', 'prevent_featured_youtube_videos' ); | |
function prevent_featured_youtube_videos( $embed ) { | |
return str_replace( '?feature=oembed', '?feature=oembed&rel=0', $embed ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment