oembed_fetch_url
Filters the oEmbed URL to be fetched.
Usage
add_filter( 'oembed_fetch_url', 'wp_kama_oembed_fetch_url_filter', 10, 3 ); /** * Function for `oembed_fetch_url` filter-hook. * * @param string $provider URL of the oEmbed provider. * @param string $url URL of the content to be embedded. * @param array $args Optional. Additional arguments for retrieving embed HTML. See wp_oembed_get() for accepted arguments. * * @return string */ function wp_kama_oembed_fetch_url_filter( $provider, $url, $args ){ // filter... return $provider; }
- $provider(string)
- URL of the oEmbed provider.
- $url(string)
- URL of the content to be embedded.
- $args(array)
- Optional. Additional arguments for retrieving embed HTML. See wp_oembed_get() for accepted arguments.
Default: ''
Changelog
Since 2.9.0 | Introduced. |
Since 4.9.0 | The dnt (Do Not Track) query parameter was added to all oEmbed provider URLs. |
Where the hook is called
oembed_fetch_url
wp-includes/class-wp-oembed.php 551
$provider = apply_filters( 'oembed_fetch_url', $provider, $url, $args );