-
-
Save dexit/e2c32c8648e2d0ac624175f843d0972a to your computer and use it in GitHub Desktop.
Wordpress: Get YouTube thumbnail URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Helpers: Videos | |
*/ | |
function dt_get_youtube_thumbnail_url($youtube_video_id) | |
{ | |
return $youtube_video_id | |
? 'https://img.youtube.com/vi/' . $youtube_video_id . '/0.jpg' // get first thumbnail from youtube | |
: ''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment