image_get_intermediate_size
Filters the output of image_get_intermediate_size()
Использование
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 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(строка|int[])
- Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).
Список изменений
| С версии 4.4.0 | Введена. |
Где вызывается хук
image_get_intermediate_size
wp-includes/media.php 873
return apply_filters( 'image_get_intermediate_size', $data, $post_id, $size );