oembed_response_data

Filters the oEmbed response data.

Description

apply_filters( 'oembed_response_data', (array) $data, (WP_Post) $post, (int) $width, (int) $height ); 

Parameters (4)

0. $data (array)
The response data.
1. $post (WP_Post)
The post object.
2. $width (int)
The requested width.
3. $height (int)
The calculated height.

Usage

To run the hook, copy the example below.
  1. $data = apply_filters( 'oembed_response_data', $data, $post, $width, $height ); 
  2.  
  3. if ( !empty( $data ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the oembed_response_data callback 
  2. function filter_oembed_response_data( $data, $post, $width, $height ) { 
  3. // make filter magic happen here... 
  4. return $data
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'oembed_response_data', 'filter_oembed_response_data', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'oembed_response_data', 'filter_oembed_response_data', 10, 4 ); 

Defined (2)

The filter is defined in the following location(s).

/wp-includes/embed.php  
  1. return apply_filters( 'oembed_response_data', $data, $post, $width, $height ); 
/wp-includes/default-filters.php  
  1. add_filter( 'oembed_response_data', 'get_oembed_response_data_rich', 10, 4 );