uploads - How to handle image resize in media_handle_sideload?

admin2025-01-07  5

I am using media_handle_sideload function to upload images in my plugin. Is it possible to disable image resize or set it to a specific size and do not make copies (upload only resized image).

I am using media_handle_sideload function to upload images in my plugin. Is it possible to disable image resize or set it to a specific size and do not make copies (upload only resized image).

Share Improve this question asked Feb 7, 2013 at 22:34 user1692333user1692333 4372 gold badges9 silver badges17 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

If you look at media_handle_sideload in source, you can see how it works.

The function that generates the various sizes is within wp_generate_attachment_metadata, the image_make_intermediate_size function.

You could possibly use the wp_handle_sideload function instead and manually resize it via image_make_intermediate_size.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736257893a472.html

最新回复(0)