Created
March 11, 2015 19:50
-
-
Save tacensi/fb2aed96b58116b5bade to your computer and use it in GitHub Desktop.
Add aditional parameters do Vimeo oembed
This file contains 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
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