Created
October 9, 2013 06:02
-
-
Save remcotolsma/6896862 to your computer and use it in GitHub Desktop.
WordPress enable Vimeo API for 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
<?php | |
/** | |
* Enable Vimeo API for oEmbed | |
*/ | |
function prefix_oembed_enable_vimeo_api( $provider, $url, $args ) { | |
if ( strpos( $provider, 'vimeo.com' ) ) { | |
$provider = add_query_arg( array( | |
'api' => '1', | |
'player_id' => isset( $args['player_id'] ) ? $args['player_id'] : false | |
), $provider ); | |
} | |
return $provider; | |
} | |
add_filter( 'oembed_fetch_url', 'prefix_oembed_enable_vimeo_api', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment