Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WordPress enable Vimeo API for oEmbed
<?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
You can’t perform that action at this time.