1

In Wordpress, we have added our own intermediate image sizes to the standard Wordpress sizes using add_image_size().

Using our own admin interface to upload images, we then use wp_generate_attachment_metadata() to create all thumbnails and save them to a predefined folder on the server.

However, we would like to restrict wp_generate_attachment_metadata() to generate our custom defined image sizes ONLY and ignore the Wordpress standard sizes.

Is this possible?

Thanks in advance for any help!

1 Answer 1

2

wp_generate_attachment_metadata() uses get_intermediate_image_sizes() to get the sizes to work on, which makes them filterable via intermediate_image_sizes.

Additionally, you can filter them after cleanup with intermediate_image_sizes_advanced, the result should be the same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.