Function: wp_filter_pre_oembed_result

wp_filter_pre_oembed_result( null | string $result, string $url, array $args )

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.

Parameters

Name Type(s) Default Value Description
$result null | string

The UNSANITIZED (and potentially unsafe) HTML that should be used to embed. Default null.

$url string

The URL that should be inspected for discovery <link> tags.

$args array

oEmbed remote get arguments.

Returns

null | string

The UNSANITIZED (and potentially unsafe) HTML that should be used to embed. Null if the URL does not belong to the current site.

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.