Support

Account

Home Forums ACF PRO Create multiple images from one ACF upload Reply To: Create multiple images from one ACF upload

  • If you do not want to use add_image_size() for all the image sizes you need then what you need to do is create an acf/save_post filter. In this filter you would use a combination of WP functions.

    $imagedata = wp_get_attachment_metadata($attachment_id); to get all of the existing metadata

    $resized = image_make_intermediate_size(get_attached_file($attachment_id), $width, $height, $crop); to have WP create the new image size

    $imagedata['sizes'][$name] = $resized; to append your new size with your new name to the metadata

    and then update the metadata wp_update_attachment_metadata($attachment_id, $imagedata);