Created
December 27, 2013 04:46
-
-
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/
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
// 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