How can i put a youtube video on my post without show the default title from youtube?
I tried to put this code in the theme´s functions, but not worked.
function remove_youtube_controls($code){
if(strpos($code, 'youtu.be') !== false || strpos($code, 'youtube.com') !== false){
$return = preg_replace("@src=(['\"])?([^'\">s]*)@", "src=$1$2&showinfo=0&rel=0", $code);
return $return;
}
return $code;
}
add_filter('embed_handler_html', 'remove_youtube_controls');
add_filter('embed_oembed_html', 'remove_youtube_controls');
Someone can help?
Thanks
$return = preg_replace("@src=(['\"])?([^'\">s]*)@", "src=$1$2&showinfo=0&rel=0", $code);
to ` $return = preg_replace("@src=(['\"])?([^'\">]*)@", "src=$1$2&showinfo=0&rel=0", $code);` – Bikash Waiba Jun 10 '17 at 22:42