oembed_result filter-hookWP 2.9.0

Filters the HTML returned by the oEmbed provider.

Usage

add_filter( 'oembed_result', 'wp_kama_oembed_result_filter', 10, 3 );

/**
 * Function for `oembed_result` filter-hook.
 * 
 * @param string|false $data The returned oEmbed HTML (false if unsafe).
 * @param string       $url  URL of the content to be embedded.
 * @param string|array $args Optional. Additional arguments for retrieving embed HTML. See wp_oembed_get() for accepted arguments.
 *
 * @return string|false
 */
function wp_kama_oembed_result_filter( $data, $url, $args ){

	// filter...
	return $data;
}
$data(string|false)
The returned oEmbed HTML (false if unsafe).
$url(string)
URL of the content to be embedded.
$args(string|array)
Optional. Additional arguments for retrieving embed HTML. See wp_oembed_get() for accepted arguments.
Default: ''

Changelog

Since 2.9.0 Introduced.

Where the hook is called

WP_oEmbed::get_html()
oembed_result
WP_oEmbed_Controller::get_proxy_item()
oembed_result
wp-includes/class-wp-oembed.php 420
return apply_filters( 'oembed_result', $this->data2html( $data, $url ), $url, $args );
wp-includes/class-wp-oembed-controller.php 226
$data->html = apply_filters( 'oembed_result', _wp_oembed_get_object()->data2html( (object) $data, $url ), $url, $args );

Where the hook is used in WordPress

Usage not found.