image_downsize filter-hook . WP 2.5.0
Filters whether to preempt the output of image_downsize().
Returning a truthy value from the filter will effectively short-circuit down-sizing the image, returning that value instead.
Usage
add_filter( 'image_downsize', 'filter_function_name_1990', 10, 3 ); function filter_function_name_1990( $downsize, $id, $size ){ // filter... return $downsize; }
- $downsize(true/false/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).
Changelog
Since 2.5.0 | Introduced. |
Where the hook is called
image_downsize
wp-includes/media.php 207
$out = apply_filters( 'image_downsize', false, $id, $size );
wp-includes/media.php 3932
$downsize = apply_filters( 'image_downsize', false, $attachment->ID, $size );