I'd like to suppress related YouTube videos by appending '&rel=0' to the string of embed attributes output to the video iframe in my post.
I believe this requires a filter that modifies the $attr array before it is passed to wp_embed_handler_youtube() (located in wp-includes/media.php).
Assuming I'm on the right track, is there a way to add a filter to my child theme to accomplish this?
Thanks in advance for your help!
Ok, so I'm still pretty lost... here is the code in my functions.php:
function modify_YT_embed_attributes($embed, $attr, $url, $rawattr) {
$attr["rel"] = "0"; //modify the attributes array
return $embed;
}
add_filter('wp_embed_handler_youtube', 'modify_YT_embed_attributes', 10, 4);
Still not working. What is the obvious thing I'm missing?
wp_embed_handler_youtube