Skip to content

Instantly share code, notes, and snippets.

@tacensi
Created March 11, 2015 19:50
Show Gist options
  • Save tacensi/fb2aed96b58116b5bade to your computer and use it in GitHub Desktop.
Save tacensi/fb2aed96b58116b5bade to your computer and use it in GitHub Desktop.
Add aditional parameters do Vimeo oembed
add_filter('oembed_result', 'custom_oembed_result', 10, 3);
function custom_oembed_result($html, $url, $args) {
if ($args) {
$newargs = $args;
$parameters = http_build_query($newargs);
$html = preg_replace('/(player.vimeo.com\/video\/[0-9]*)/i', '$1?' . $parameters, $html);
}
return $html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment