Ticket #46986: 46986.diff
File 46986.diff, 1.5 KB (added by , 4 years ago) |
---|
-
src/wp-includes/class-wp-oembed.php
520 520 $provider = add_query_arg( 'maxwidth', (int) $args['width'], $provider ); 521 521 $provider = add_query_arg( 'maxheight', (int) $args['height'], $provider ); 522 522 $provider = add_query_arg( 'url', urlencode( $url ), $provider ); 523 $provider = add_query_arg( 'dnt', 1, $provider ); 523 if ( strpos( $provider, 'vimeo.com' ) !== false ) { 524 $provider = add_query_arg( 'dnt', 1, $provider ); 525 } 524 526 525 527 /** 526 528 * Filters the oEmbed URL to be fetched. … … 527 529 * 528 530 * @since 2.9.0 529 531 * @since 4.9.0 The `dnt` (Do Not Track) query parameter was added to all oEmbed provider URLs. 532 * @since 5.6.0 The `dnt` (Do Not Track) query parameter was removed from Vimeo oEmbed URLs. 530 533 * 534 * The `dnt` parameter can be re-enabled on Vimeo oEmbed URLs using the following: 535 * 536 * function enable_dnt_vimeo_oembed( $provider, $url, $args ) { 537 * if ( strpos( $provider, 'vimeo.com' ) !== false ) { 538 * $provider = add_query_arg( 'dnt', 1, $provider ); 539 * } 540 * return $provider; 541 * } 542 * add_filter( 'oembed_fetch_url', 'enable_dnt_vimeo_oembed', 10, 3 ); 543 * 531 544 * @param string $provider URL of the oEmbed provider. 532 545 * @param string $url URL of the content to be embedded. 533 546 * @param array $args Optional arguments, usually passed from a shortcode.