Function: image_make_intermediate_size

image_make_intermediate_size( string $file, integer $width, integer $height, boolean $crop )

Resizes an image to make a thumbnail or intermediate size.

The returned array has the file size, the image width, and image height. The \'image_make_intermediate_size' filter can be used to hook in and change the values of the returned array. The only parameter is the resized file path.

Parameters

Name Type(s) Default Value Description
$file string

File path.

$width integer

Image width.

$height integer

Image height.

$crop boolean false

Optional. Whether to crop image to specified width and height or resize. Default false.

Returns

false | array

False, if no image was created. Metadata array on success.

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.