Create multiple smaller images from a single source.
Description
Attempts to create all sub-sizes and returns the meta data at the end. This may result in the server running out of resources. When it fails there may be few "orphaned" images left over as the meta data is never returned and saved. As of 5.3.0 the preferred way to do this is with make_subsize(). It creates the new images one at a time and allows for the meta data to be saved after each new image is created.
Parameters
$sizesarray
An array of image size data arrays. Either a height or width must be provided. If one of the two is set to null, the resize will maintain aspect ratio according to the provided dimension. @type array ...$0 { Array of height, width values, and whether to crop.
$widthint
Image width. Optional if $height is specified.
$heightint
Image height. Optional if $width is specified.
$cropbool|arraydefault: false. }
Optional. Whether to crop the image.
Return
array
An array of resized images' metadata by size.
Uses · 2
is_wp_error()Checks whether the given variable is a WordPress Error.
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/class-wp-image-editor-imagick.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.