For my Wordpress website I want to generate programmatically and automatically an extra photo size while a user uploads a picture. I want this photo also to appear in the media library.
I wrote a little side plugin which I activate to hook into the upload action. My question is, which wp upload action I should hook into to generate this extra size of the uploaded image.
Example of getting the current upload and write the extra image entry are welcome.
Thanks!
You can try wp_handle_upload_prefilter:
Follow above to hook the upload action, and do some like generate extra image: