oembed_response_data хук-фильтрWP 4.4.0

Filters the oEmbed response data.

Использование

add_filter( 'oembed_response_data', 'wp_kama_oembed_response_data_filter', 10, 4 );

/**
 * Function for `oembed_response_data` filter-hook.
 * 
 * @param array   $data   The response data.
 * @param WP_Post $post   The post object.
 * @param int     $width  The requested width.
 * @param int     $height The calculated height.
 *
 * @return array
 */
function wp_kama_oembed_response_data_filter( $data, $post, $width, $height ){

	// filter...
	return $data;
}
$data(массив)
The response data.
$post(WP_Post)
The post object.
$width(int)
The requested width.
$height(int)
The calculated height.

Список изменений

С версии 4.4.0 Введена.

Где вызывается хук

get_oembed_response_data()
oembed_response_data
wp-includes/embed.php 609
return apply_filters( 'oembed_response_data', $data, $post, $width, $height );

Где используется хук в WordPress

wp-includes/default-filters.php 708
add_filter( 'oembed_response_data', 'get_oembed_response_data_rich', 10, 4 );