Opened 3 years ago

Last modified 7 months ago

#12493 new enhancement

Filter $bits in wp_upload_bits()

Reported by: Viper007Bond Owned by: josephscott
Priority: normal Milestone: Future Release
Component: XML-RPC Version: 3.0
Severity: normal Keywords: has-patch mobile
Cc: ercoli@…

Description

It'd be nice if there was a filter on $bits in wp_upload_bits() to allow plugins to modify uploads coming in from XML-RPC. Resizing, watermarking, etc. are all example uses for this filter.

Since it's a simple filter, perhaps it could be slipped into 3.0.

Attachments (2)

12493.patch (460 bytes) - added by Viper007Bond 3 years ago.
12493.2.patch (471 bytes) - added by Viper007Bond 3 years ago.
Pass the filename so it can be used to determine file type

Download all attachments as: .zip

Change History (8)

To clarify, yes this can be done after the file is saved to the filesystem, but then the thumbnails must be regenerated and the meta data updated. A big hassle.

comment:2 follow-up: ↓ 3   josephscott3 years ago

If we are going to do this have you looked at adding a corresponding filter for uploads done via AtomPub?

comment:3 in reply to: ↑ 2   Viper007Bond3 years ago

Replying to josephscott:

If we are going to do this have you looked at adding a corresponding filter for uploads done via AtomPub?

AtomPub uses wp_upload_bits() too, doesn't it?

Pass the filename so it can be used to determine file type

I have thoroughly tested this tonight via XML-RPC and it works awesome. I don't have an AtomPub client though, but I don't see why it wouldn't work as it's the same kinda thing.

  • Keywords mobile added
  • Cc ercoli@… added
Note: See TracTickets for help on using tickets.