image_get_intermediate_size

Filters the output of image_get_intermediate_size().

Description

apply_filters( 'image_get_intermediate_size', (array) $data, (int) $post_id, (string|array) $size ); 

Parameters (3)

0. $data (array)
Array of file relative path, width, and height on success. May also include file absolute path and URL.
1. $post_id (int)
The post_id of the image attachment
2. $size (string|array)
Registered image size or flat array of initially-requested height and width dimensions (in that order).

Usage

To run the hook, copy the example below.
  1. $data = apply_filters( 'image_get_intermediate_size', $data, $post_id, $size ); 
  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 image_get_intermediate_size callback 
  2. function filter_image_get_intermediate_size( $data, $post_id, $size ) { 
  3. // make filter magic happen here... 
  4. return $data
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'image_get_intermediate_size', 'filter_image_get_intermediate_size', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'image_get_intermediate_size', 'filter_image_get_intermediate_size', 10, 3 ); 

Defined (1)

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

/wp-includes/media.php  
  1. return apply_filters( 'image_get_intermediate_size', $data, $post_id, $size );