On this page
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
$downsizebool|array-
Whether to short-circuit the image downsize.
$idint-
Attachment ID for image.
$sizestring|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. View all references
$out = apply_filters( 'image_downsize', false, $id, $size );
Related
Used By
| Used By | Description |
|---|---|
| wp_prepare_attachment_for_js() wp-includes/media.php | Prepares an attachment post object for JS, where it is expected to be JSON-encoded and fit into an Attachment model. |
| image_downsize() wp-includes/media.php | Scales an image to fit a particular size (such as ‘thumb’ or ‘medium’). |
Changelog
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/image_downsize