Skip to content

Instantly share code, notes, and snippets.

@Garconis
Last active February 29, 2024 12:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Garconis/6d972904f1cfee0db3d1e4152c840f6f to your computer and use it in GitHub Desktop.
Save Garconis/6d972904f1cfee0db3d1e4152c840f6f to your computer and use it in GitHub Desktop.
WordPress | remove dnt=1 parameter from Vimeo oEmbed iframe URL (jQuery method)
// 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
jQuery(document).ready(function($){
// find any Vimeo iframe
$('iframe[src*="player.vimeo.com"]').each(function(){
// get the src
var src = $(this).attr('src');
// replace parameter with nothing
$(this).attr('src',src.replace('dnt=1&', ''));
});
});
@Garconis
Copy link
Author

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