WordPress.org

Forums

Youtube oembed remove iframe (1 post)

  1. zagriyen
    Member
    Posted 3 years ago #

    Hi,
    How to remove iframe for embed youtube video and use the old code without iframe ?
    I want remove title infos etc,
    i use this but it doesnt work

    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 width="'.$args['width'].'" height="'.$args['height'].'" src="http://www.youtube.com/embed/'.$id['v'].'?showsearch=0&showinfo=0&playlist=&modestbranding=1&egm=0&rel=0" frameborder="0" allowfullscreen></iframe>';
        }
        return $html;
    }
    add_filter('oembed_result','Oembed_youtube_no_title',10,3);

    Thanks in advance

Topic Closed

This topic has been closed to new replies.

About this Topic