I found it after trying with several hooks.
Use ‘init’ and check if $_FILES is empty, if not, do what you want to do.
Related Posts:
- Hook to get image filename when it is uploaded
- How can I add an image upload field directly to a custom write panel?
- Hook event for upload image in the menu
- Is there a better way to implement responsive images than what WordPress uses by default?
- What filter should I use to insert a button inside on Media>Add New
- Upload multiple images and insert them into custom html code
- Cleaning a filename after image sideloading a url that contains `%20`
- How to move an image in a plugin to the upload directory and make it as a media of wordpress?
- WordPress discards PNG file when uploading plugin file
- Is it possible to convert various image types from remote URLs to WebP and then serve them immediately?
- Using “add_image_size” to register custom image sizes inside plugins not working
- Leveraging Core Functionality in Icon Upload Plugin [closed]
- Upload to a specific media folder created by FileBird Lite
- Images stored from external API not loading
- Difference Between Filter and Action Hooks?
- How many times will this code run? (or, how rich is grandma?)
- Which hook should be used to add an action containing a redirect?
- add_action hook for completely new post?
- Checking if a file is already in the Media Library
- Standard location for plugin to save/cache files?
- Add a new tab to WordPress Plugin install Listing
- Saving data-URI to media library
- Is there a hook which fires after all thumbnails are generated?
- Changing Plugin Load Order
- Admin settings update updating every time home page is hit?
- WordPress Hook for user register
- How to implement add_image_size in a plugin
- Can I use the wp media uploader for my own plugin?
- Change Media Uploader default directory
- Global Objects and Public Methods
- Using filters and actions for plugin API?
- How should you hook a session_start() when authoring a plugin?
- Init action hook running late after PayPal’s return url?
- Is there widely accepted phpDoc syntax for documenting which hook calls a function?
- Explanation of the “posts_join” and “posts_fields” filter hooks?
- How do you use the plugin boilerplate loader class to hook actions and filters?
- How Do I Load My Action Earlier Enough?
- Prevent plugin activation and add admin notice
- how to retrieve post_id under woocommerce_add_to_cart_validation hook?
- Changed media upload path for plugin, but generates error & shows wrong url
- How and when would I implement some code which would take data from one part of the Db and put it in another?
- add_option_{$option} action hook not being called
- How to destroy or dispose wordpress uploder/manager?
- Unable to show a message after plugin activation
- plugin modal/popup integration best practice
- Function not working on any file other than the main plugin file
- Caption Shortcode: what filter to change the image size?
- Does WordPress have something like timer hook?
- Multi hook deploiement
- Can I use a hook other than ‘init’ to handle form submissions?
- Filter the_content() to add custom figure tags
- Template file structure , wordpress hook for altering the template
- woocommerce single product page hook not working
- How can I set a dynamic value for post_updated_messages based on return value of post_updated?
- Issue on Getting WP Gallery Items In cpt-single.php As Attachments
- What is the use of wp_schedule_event hook?
- Displaying $_FILES data (simlar to $_POST)
- Changing upload directory for plugin uploads only
- How do I replace title with my plugin?
- Looking for Hook that is fired after a plugin or wp upgrade is installed/updated
- Get user logged in status from within a plugin. $current_user not defined
- How do you filter get_media_items by mime type in a custom media upload tab?
- Custom filename when pasting an image from clipboard
- Images not displaying on live server
- Woocommerce: block user removing cart item
- how to insert content into wp_head after loop_end
- upload script in plugin development [duplicate]
- Insert plugin html content to a specific spot in the frontpage
- Apply function on all action hooks?
- How can I get a plugin to hook ‘dbdelta_queries’ — a filter used during version update?
- Send retrieve password notification email with custom HTML email template
- How to automatically convert images to WebP on WordPress?
- Send Webhook when post-status is publish or trash
- get_term_by() returning null on plugin
- wp_head is not fired from the hook I have used in my plugin
- Trigger a JavaScript function based on the data fetched from Woo commerce hook
- Displaying an Uploaded Image as a Custom Avatar in WordPress
- Add a custom image source
- Load images from CDN and custom features to “Add Media” dialogue
- Ninja Forms: Front-End Forms, Post ID?
- upload image to wordpress media library failed for custom post type
- Execute callback after REST API request completes + Response is sent
- Set srcset on a block image
- Custom fields in the billing address section woocommerce
- wp media uploader and ID3 tags
- How to use useSelect to retrieve the currently default fontFamily?
- WordPress Playground and uploading permission issue
- How to customize password reset message page on success if no error in password reset
- Do uploaded files to /tmp/ get deleted in WordPress automatically?
- Is there a hook for updated image metadata upon using image editor?
- Can I know what changes happened after using native Image Editor?
- Can’t save Image from external API into Database
- How to modify the uploads directory for wp.media.frame assigning an subfolder name
- Does a wordpress custom plugin is fired by default on php theme ajax request?
- WordPress Media Uploader not displaying image that has just been uploaded
- How to run this plugin every time a post is saved?
- Multimedia upload error in my wordpress job board plugin
- how to execute a function only when i send an order to trash [closed]
- Are woocommerce_thankyou hook and is_order_received_page() redundant? [closed]
- Show Image in Plugin Development