[wp-trac] [WordPress Trac] #16849: Add a filter for $overrides in wp_handle_upload()
WordPress Trac
noreply at wordpress.org
Thu Oct 29 02:50:53 UTC 2020
#16849: Add a filter for $overrides in wp_handle_upload()
------------------------------------+-----------------------------
Reporter: iandunn | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Upload | Version: 3.1
Severity: normal | Resolution:
Keywords: has-patch dev-feedback | Focuses:
------------------------------------+-----------------------------
Comment (by CrazyJaco):
Bumping this issue.
I work for a regional publisher.
Our uploads directory for a given month is quite large. Large enough that
wp_unique_filename is a bottleneck. I want to short circuit the scandir()
in the function.
I'd like to add a unique_filename_callback, but there is no way to
override that.
Using WP-CLI's {{{ wp media import }}}, it invokes
{{{media_handle_sideload()}}}. There is no way to override or pass in the
{{{ $overrides['unique_filename_callback'] }}} in
{{{wp_unique_filename()}}} using these higher level functions.
I believe the patch above (16489.3.patch) would allow for that, though.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/16849#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list