-
-
Save fovoc/d4e84dd4a760390bff4d580a0d935ce8 to your computer and use it in GitHub Desktop.
Disable related videos in CoursePress youtube featured 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 | |
add_filter( 'oembed_result', function( $embed, $url, $args ) { | |
$url_string = parse_url( $url, PHP_URL_QUERY ); | |
parse_str( $url_string, $id ); | |
if( isset( $id['v'] ) ) | |
{ | |
return str_replace( '?feature=oembed', '?feature=oembed&rel=0', $embed ); | |
} | |
return $embed; | |
}, 99, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment