Use wp_handle_upload() with MIME Allowlists for File Uploads | BeforeMerge Rules | BeforeMerge