Make WordPress Core

Opened 10 years ago

Last modified 7 years ago

#38481 new enhancement

wp_handle_upload_prefilter not used before deriving attachment title

Reported by: frodeborli Owned by:
Priority: normal Milestone: Awaiting Review
Component: Upload Version: 4.6.1
Severity: normal Keywords: dev-feedback
Cc: Focuses:

Description

I created a module that modifies upload behavior. I use the wp_handle_upload_prefilter to alter the $_FILES data - specifically the 'name' property of the uploaded file.

This works well for changing the name of the file being stored in the file system, but the title of the attachment post still accesses the $_FILESasync-uploadname on line 281 of media.php.

To be able to override the title, I had to hook into the 'sanitize_title' filter on line 293 of media.php - and doing that is, in my book, a hack.

This sanitize_title filter should specify a context.

Change History (1)

#1 @antpb
10 years ago

  • Keywords dev-feedback added
  • Type defect (bug)enhancement
Note: See TracTickets for help on using tickets.