Function: wp_filter_oembed_result

wp_filter_oembed_result( string $result, object $data, string $url )

Filters the given oEmbed HTML.

If the $url isn't on the trusted providers list, we need to filter the HTML heavily for security.

Only filters 'rich' and 'html' response types.

Parameters

Name Type(s) Default Value Description
$result string

The oEmbed HTML result.

$data object

A data object result from an oEmbed provider.

$url string

The URL of the content to be embedded.

Returns

string

The filtered and sanitized oEmbed result.

WordPress Developer Newsletter

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