Resizes an image to make a thumbnail or intermediate size.
Description
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
$filestring
File path.
$widthint
Image width.
$heightint
Image height.
$cropbool|arrayoptional
Image cropping behavior. If false, the image will be scaled (default). If true, image will be cropped to the specified dimensions using center positions. If an array, the image will be cropped using the array to specify the crop location: @type string $0 The x crop position. Accepts 'left', 'center', or 'right'.Default: false
$1string
The y crop position. Accepts 'top', 'center', or 'bottom'.
Return
array|false
Metadata array on success. False if no image was created.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/media.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.