Make WordPress Core

Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#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:


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)

upload-functions.php.diff (494 bytes) - added by pixline 15 years ago.

Download all attachments as: .zip

Change History (11)

#1 @foolswisdom
15 years ago

  • Milestone changed from 2.1.2 to 2.2

#2 @Nazgul
15 years ago

  • Keywords has-patch added; add filter upload overrides filename removed

#3 @westi
15 years ago

  • Keywords dev-feedback added

-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??

#4 @pixline
15 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. :-)

#5 @foolswisdom
15 years ago

  • Milestone changed from 2.2 to 2.3

#6 @foolswisdom
14 years ago

  • Milestone changed from 2.3 to 2.4 (next)

#7 @darkdragon
14 years ago

  • Keywords new-hook added

#8 @pixline
14 years ago

is this going into 2.5, or can I close this ticket? :-)

#9 @pixline
14 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

#10 @Nazgul
14 years ago

  • Milestone 2.5 deleted
Note: See TracTickets for help on using tickets.