WordPress.org

Support

Support » Plugins and Hacks » Youtube oembed remove iframe

Youtube oembed remove iframe

  • 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

  • The topic ‘Youtube oembed remove iframe’ is closed to new replies.