wp_create_image_subsizes
wp_create_image_subsizes ( $file, $attachment_id )
Parameters:- (string) file Full path to the image file.
- (int) attachment_id Attachment ID to process.
Returns:- (array) The image attachment meta data.
Defined at: - Introduced in WordPress: 5.3.0
- Deprecated in WordPress: —
Description
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.