image_downsize WordPress Filter Hook
This hook is used to downsize an image that has been uploaded to WordPress. It allows you to set a maximum width and height for the image, and will automatically crop and resize the image to fit within those dimensions. This is useful for creating thumbnails or for displaying images in a fixed-size container.
apply_filters( 'image_downsize', bool|array $downsize , int $id , string|int[] $size ) #
Filters whether to preempt the output of image_downsize().
Description
Returning a truthy value from the filter will effectively short-circuit down-sizing the image, returning that value instead.
Parameters
- $downsize
(bool|array)Whether to short-circuit the image downsize.
- $id
(int)Attachment ID for image.
- $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).
Source
File: wp-includes/media.php
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |