How to correctly use oembed to pull thumbs from youtube
I show a lot of thumbs on my homepage from youtube videos. I was using this function below to grab the thumb from a youtube url which works fast but it doesn't work for url's in the shortned form like youtu.be/JSHDLSKL. function get_youtube_screen_link( $url = '', $type = 'default', $echo = true ) { if( empty( $url ) ) return false; if( !isset( $type ) ) $type = ''; $url = esc_url( $url ); preg_match("|[\\?&]v=([^&#]*)|",$url,$vid_id); if( !isset( $vid_id[1] ) ) return false; $img_server_num = 'i'. rand(1,4); switch( $type ) { case 'large': $img_link = "http://{$img_server_num}.ytimg.com/vi/{