Filters the oEmbed result before any HTTP requests are made.
If the URL belongs to the current site, the result is fetched directly instead of going through the oEmbed discovery process.
$resultnull|stringrequired
$urlstringrequired
<link> tags.$argsarrayrequired
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;
}
| Version | Description |
|---|---|
| 4.5.3 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_filter_pre_oembed_result