Skip to content

Instantly share code, notes, and snippets.

@zeropointdevelopment
Created December 27, 2013 04:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeropointdevelopment/8142700 to your computer and use it in GitHub Desktop.
Save zeropointdevelopment/8142700 to your computer and use it in GitHub Desktop.
[WordPress] Code from our blog post Passing Parameters to a Video Link in a WordPress Custom Field - http://www.limecanvas.com/passing-parameters-to-a-video-link-in-a-wordpress-custom-field/
// Filter video output
add_filter('oembed_result','lc_oembed_result', 10, 3);
function lc_oembed_result($html, $url, $args) {
// $args includes custom argument
$newargs = $args;
// get rid of discover=true argument
array_pop( $newargs );
$parameters = http_build_query( $newargs );
// Modify video parameters
$html = str_replace( '?feature=oembed', '?feature=oembed'.'&'.$parameters, $html );
return $html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment