[ad_1]
Yes, you are correct.
You may want to subscribe to nmr_create_attachment_file_name filter, call wp_unique_filename and change the file name before the file is saved.
Thread Starter
jishua
(@jishua)
Thanks a lot for confirming. Just wondering if there’s a reason that’s not implemented.
I’m happy to contribute that update if you like. Just let me know.
I’ve briefly consider it, now when you mentioned it.
Looking at the code, something is not yet clear to me:
- user uploads a file in CF7
- this plugin gets the filename
- should we change the filename here, if the filename already exists in the media library?
- raise this event/filter:
nmr_create_attachment_file_name– send the potentially new filename to subscribers – remember this might not be the same filename the user uploaded. Does it matter? I don’t know, but it’s solvable by everyone with a bit of code as pointed above
So, I haven’t implemented it yet. Please consider the reach of this change, how it might affect other websites using it and if you are confident you may contribute the solution.
Thread Starter
jishua
(@jishua)
That’s a very good point. I wouldn’t want to break anything for other users of the plugin if they’re always expecting the same filename. Maybe an option to enable it at some point.
