Embeds: Add the `dnt` (Do Not Track) query parameter to all oEmbed provider URLs.

This means that, for those providers that support this somewhat de-facto standard, visitor tracking is disabled by default for all embeds.

Props norcross, joostdevalk

Fixes #41784


git-svn-id: https://develop.svn.wordpress.org/trunk@41345 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2017-09-08 12:30:03 +00:00
parent 085b1411bd
commit 5c3d713beb
1 changed files with 2 additions and 0 deletions

View File

@ -490,11 +490,13 @@ class WP_oEmbed {
$provider = add_query_arg( 'maxwidth', (int) $args['width'], $provider );
$provider = add_query_arg( 'maxheight', (int) $args['height'], $provider );
$provider = add_query_arg( 'url', urlencode($url), $provider );
$provider = add_query_arg( 'dnt', 1, $provider );
/**
* Filters the oEmbed URL to be fetched.
*
* @since 2.9.0
* @since 4.9.0 The `dnt` (Do Not Track) query parameter was added to all oEmbed provider URLs.
*
* @param string $provider URL of the oEmbed provider.
* @param string $url URL of the content to be embedded.