Skip to content

Instantly share code, notes, and snippets.



Last active Feb 18, 2020
What would you like to do?
A function that takes a vimeo url and returns the video ID
function get_vimeo_id( $url ) {
* Matches:
preg_match( '/(vimeo\.com\/)(?:video\/)?([\d]+)/', $url, $matches );
$vimeo_id = $matches[2];
return $vimeo_id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment