wp_create_image_subsizes ( $file, $image_meta, $attachment_id )
- (string) $file Full path to the image file.
- (array) $image_meta The attachment meta data array.
- (int) $attachment_id Attachment Id to process.
- (array) The attachment metadata with updated `sizes` array. Includes an array of errors encountered while resizing.
- Introduced in WordPress: 5.3.0
- Deprecated in WordPress: —
Creates image sub-sizes, adds the new data to the image meta `sizes` array, and updates the image metadata.
Intended for use after an image is uploaded. Saves/updates the image metadata after each
sub-size is created. If there was an error, it is added to the returned image metadata array.