image_get_intermediate_size filter-hookWP 4.4.0

Usage

add_filter( 'image_get_intermediate_size', 'wp_kama_image_get_intermediate_size_filter', 10, 3 );

/**
 * Function for `image_get_intermediate_size` filter-hook.
 * 
 * @param array        $data    Array of file relative path, width, and height on success. May also include file absolute path and URL.
 * @param int          $post_id The ID of the image attachment.
 * @param string|int[] $size    Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).
 *
 * @return array
 */
function wp_kama_image_get_intermediate_size_filter( $data, $post_id, $size ){

	// filter...
	return $data;
}
$data(array)
Array of file relative path, width, and height on success. May also include file absolute path and URL.
$post_id(int)
The ID of the image attachment.
$size(string|int[])
Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).

Changelog

Since 4.4.0 Introduced.

Where the hook is called

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

Where the hook is used in WordPress

Usage not found.