WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 6 years ago

Last modified 6 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:

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)

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

Download all attachments as: .zip

Change History (11)

comment:1 foolswisdom7 years ago

  • Milestone changed from 2.1.2 to 2.2

comment:2 Nazgul7 years ago

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

comment:3 westi7 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??

comment:4 pixline7 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. :-)

comment:5 foolswisdom7 years ago

  • Milestone changed from 2.2 to 2.3

comment:6 foolswisdom7 years ago

  • Milestone changed from 2.3 to 2.4 (next)

comment:7 darkdragon6 years ago

  • Keywords new-hook added

comment:8 pixline6 years ago

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

comment:9 pixline6 years ago

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

comment:10 Nazgul6 years ago

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