I was able to temporarily disable an automatic task of wordpress during a specific file type upload which is nice. For instance, I changed the usual upload path for the pdf uploads by doing this:
//change the normal path update_option('upload_path','wp-content/uploads/attachments/'.$id); //upload the file $upload = wp_upload_bits($pdffile,null,file_get_contents($pdffile_temp)); //get the standard path back update_option('upload_path','');
Now I would like to do the same with the "wp unique filename" function that is automatically called by wordpress. The same way I changed temporarily the path for this specific upload routine, I would like not to rename the file if another one has the same name inside the target folder (I would rather overwrite the old file with the new one instead).
How could I do that?