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
$video_url = get_post_meta( get_the_ID(), 'mb_youtube_url', true ); | |
// Parse video ID from given url | |
if (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $video_url, $match)) { | |
$video_id = $match[1]; // Return video ID | |
} |
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 | |
// Account to get the videos from | |
$username = 'user6002596'; | |
// Do request to Vimeo API | |
$request = 'http://vimeo.com/api/v2/'. $username .'/videos.xml'; | |
// Parse into SimpleXML object | |
$vimeo = simplexml_load_file($request); |
NewerOlder