Written by Anonymous

    //YouTubeのサムネイルを取得(画像がなかった場合)
    if (empty($matches[0])) {
      preg_match('%(?:youtube\.com/(?:user/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $post[0]->post_content, $match);
      if (!empty($match[1])) {
        $matches=array(); $matches[0]=$matches[1]=array('http://img.youtube.com/vi/'.$match[1].'/mqdefault.jpg');
      }
    }
Notepad
Select All