oembed_result
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
oembed_result
oembed_result
wp-includes/class-wp-oembed.php 428
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 );