#3831 closed enhancement (wontfix)
new 'upload_overrides' filter proposal
Reported by: | pixline | Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | has-patch dev-feedback new-hook |
Focuses: | Cc: |
Description
A new filter hook for the $overrides array into wp_upload_tab_upload_action function, which lets to add optional overrides before calling wp_handle_upload. This makes possible to alter actual WP logic for renaming files after upload, i.e. adding a function that will sanitize or mangle in some ways the file name (add timestamp, change some characters, and so on).
Attachments (1)
Change History (11)
#4
@
17 years ago
Just to be clear: I'd like that *all* the $overrides array may be altered with a filter, every override element actually in the code.
This could lead to some different plugins upload-related, allowing developers to play with all the unleashed power of the $overrides array, not only about filename uniqueness, but (i.e.) with a different upload strategy, or even more.
I've proposed that patch because my first plugin (Upload+) would require about 90% less code, and it won't need to clone the entire function just to alter the $overrides array. But this is my first patch also, and I know that may be a better way to do this. :-)
-1 to this patch as stands.
Can we get a better understanding of the problem rather than accepting this iffy solution.
Would we not do better to provide a more WordPress standard way of registering a function for creating a unique filename rather than the overrides method alone.
Maybe the code from wp_handle_upload to do with filename uniqueness should move to a function in pluggable functions that can be overridden??