Support

Account

Home Forums General Issues Is it possible to add custom image sizes only for a given image custom field? Reply To: Is it possible to add custom image sizes only for a given image custom field?

  • There is a way to not generate sizes during the ACF upload, but I don’t think that it can be changed to only generate those sizes during that upload.

    To not generate sizes during the ACF upload you can use an acf/upload_prefilter filter and in that filter you can add a filter as described here in the section titled Stop Generating Image Sizes Through Adding a code to functions.php.

    It might be possible to disable generating a specific size as a general rule and only allow them to be generated during the ACF upload. However, this would depend on what values are available in the $_POST array and if you can detect that the upload is for an ACF field. I do not know what is included in $_POST during an ACF image upload or if there is any way to determine that the upload is for an ACF field or not.