Ticket #899 (closed enhancement: fixed)

Opened 4 years ago

Last modified 2 years ago

Wishlist item: hooks for file uploads

Reported by: gbhugo Assigned to:
Priority: high Milestone: 2.1
Component: Administration Version: 1.6
Severity: normal Keywords: needs-patch
Cc: dwc

Description

This hook would be called with the uploaded file, a flag that tells about wether a thumbnail was created and the caption that was given for the upload. The ratio: plugins could hook into this one to get notified when images are uploaded and could feed that data into their databases. Otherwise they can only scan the wp-content directory but the caption is lost if the user isn't using cut-and-paste to transfer it. Would be quite handy for a plugin I am currently working on.

XMLRPC uploads via metaWeblogAPI can call the same hook but just provide an empty string for the caption (as there is no caption provided by the API call).

Change History

02/16/05 23:21:53 changed by gbhugo

  • Patch set to No.

06/30/05 14:20:53 changed by skippy

  • owner changed from anonymous to skippy.
  • priority changed from normal to low.
  • version changed from 1.5 to 1.6.
  • status changed from new to assigned.

A hook on file upload would be nice. No such hook or filter exists, currently.

06/30/05 14:21:07 changed by skippy

  • keywords set to bg|2nd-opinion bg|needs-patch.

06/30/05 16:59:20 changed by markjaquith

  • priority changed from low to high.

Someone (Owen?) is working on redoing the upload functionality. It really needs a total workover. The image uploading functionality is poor... and it's something that people really expect to work well.

08/11/05 12:47:14 changed by skippy

  • milestone set to 1.5.2.

08/14/05 18:23:13 changed by matt

  • milestone changed from 1.5.2 to 1.6.

10/04/05 11:09:52 changed by skeltoac

Per a recent discussion with Matt, the wp_posts.post_status value 'object' is for recording (but not storing) uploads as post children. It is used in the new image-uploading.php and there are now object handlers in functions-post.php. A file_upload action hook should be added to any uploading functions. It should only need one parameter: post_ID.

That is, unless you plan on uploading files that aren't attached to posts.

11/13/05 02:20:34 changed by matt

  • milestone changed from 1.6 to 2.1.

09/28/06 21:34:08 changed by foolswisdom

  • keywords changed from bg|2nd-opinion bg|needs-patch to needs-patch.
  • owner deleted.
  • status changed from assigned to new.

Removing assignment to Skippy.

10/06/06 08:43:34 changed by mdawaffe

  • status changed from new to closed.
  • resolution set to fixed.

Fixed some time ago. Relevant hooks:

wp_handle_upload

add_attachment

edit_attachment