oembed_response_data filter-hookWP 4.4.0

Filters the oEmbed response data.

Usage

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(array)
The response data.
$post(WP_Post)
The post object.
$width(int)
The requested width.
$height(int)
The calculated height.

Changelog

Since 4.4.0 Introduced.

Where the hook is called

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

Where the hook is used in WordPress

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