Last active
October 19, 2022 20:39
-
-
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)
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 | |
// 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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternative method via jQuery: https://gist.github.com/Garconis/6d972904f1cfee0db3d1e4152c840f6f