Skip to content

Instantly share code, notes, and snippets.

@Garconis
Last active October 19, 2022 20:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Garconis/092e7c2440be703703947869ef6a5f39 to your computer and use it in GitHub Desktop.
Save Garconis/092e7c2440be703703947869ef6a5f39 to your computer and use it in GitHub Desktop.
WordPress | remove dnt=1 parameter from Vimeo oEmbed iframe URL (PHP function method)
<?php
// https://wordpress.org/support/topic/vimeo-oembed-now-has-dnt1-parameter/
// replace the dnt=1 parameter that WordPress adds to the Vimeo player when using oEmbed
function dl_oembed ( $provider, $url, $args ) {
if ( strpos( $provider, 'vimeo.com' ) !== false)
return add_query_arg( array('dnt' => false), $provider );
}
add_filter( 'oembed_fetch_url', 'dl_oembed', 10, 3 );
@Garconis
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment