Filters the oEmbed result before any HTTP requests are made.
Description
If the URL belongs to the current site, the result is fetched directly instead of going through the oEmbed discovery process.
Parameters
$result
null|stringrequired- The UNSANITIZED (and potentially unsafe) HTML that should be used to embed. Default null.
$url
stringrequired- The URL that should be inspected for discovery
<link>
tags. $args
arrayrequired- oEmbed remote get arguments.
Source
function wp_filter_pre_oembed_result( $result, $url, $args ) {
$data = get_oembed_response_data_for_url( $url, $args );
if ( $data ) {
return _wp_oembed_get_object()->data2html( $data, $url );
}
return $result;
}
Changelog
Version | Description |
---|---|
4.5.3 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.