Saving the pre-sanitized filename of an attachment as the Title or Caption
Unfortunately wp_handle_upload_prefilter hook does not recognize an attachment ID yet. It’s too early and runs the pre-sanitized file name (before moving the attachment and storing it as a post) The Logic What you can do is use that hook wp_handle_upload_prefilter but instead, store a transient with a short life that contains the pre-sanitized file name. … Read more