How can i add :
class="youtube-player" type="text/html"
to iframe like :
function Oembed_youtube_no_title($html,$url,$args){
$url_string = parse_url($url, PHP_URL_QUERY);
parse_str($url_string, $id);
if (isset($id['v'])) {
return '<iframe class="youtube-player" type="text/html" src="https://www.youtube.com/embed/' .$id['v'].'?vq=large&autohide=1&autoplay=1&fs=1&hl=fr&rel=0&loop=1" frameborder="0" allowfullscreen></iframe>';
}
return $html;
}
You can try this:
to target the YouTube oembed HTML output.
When I embed this YouTube link (Kraftwerk) into the post content
I get this HTML output:
with the above filter.
Just to add to birgire’s solution above, if you want to also get rid of the width and height so that you can fully control the css, adding this worked for me:
Not sure this won’t cause other problems, but tested and seems to work.