oembed_result
Filters the HTML returned by the oEmbed provider.
Использование
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(строка|false)
- The returned oEmbed HTML (false if unsafe).
- $url(строка)
- URL of the content to be embedded.
- $args(строка|массив)
- Optional. Additional arguments for retrieving embed HTML. See wp_oembed_get() for accepted arguments.
По умолчанию: ''
Список изменений
С версии 2.9.0 | Введена. |
Где вызывается хук
oembed_result
oembed_result
wp-includes/class-wp-oembed.php 427
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 );