Make WordPress Core

Opened 20 years ago

Closed 18 years ago

#899 closed enhancement (fixed)

Wishlist item: hooks for file uploads

Reported by: gbhugo's profile gbhugo Owned by:
Milestone: 2.1 Priority: high
Severity: normal Version: 1.6
Component: Administration Keywords: needs-patch
Focuses: Cc:

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 (10)

#1 @gbhugo
20 years ago

  • Patch set to No

#2 @skippy
20 years ago

  • Owner changed from anonymous to skippy
  • Priority changed from normal to low
  • Status changed from new to assigned
  • Version changed from 1.5 to 1.6

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

#3 @skippy
20 years ago

  • Keywords bg|2nd-opinion bg|needs-patch added

#4 @markjaquith
20 years ago

  • 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.

#5 @skippy
20 years ago

  • Milestone set to 1.5.2

#6 @matt
20 years ago

  • Milestone changed from 1.5.2 to 1.6

#7 @skeltoac
19 years ago

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.

#8 @matt
19 years ago

  • Milestone changed from 1.6 to 2.1

#9 @foolswisdom
18 years ago

  • Keywords needs-patch added; bg|2nd-opinion bg|needs-patch removed
  • Owner skippy deleted
  • Status changed from assigned to new

Removing assignment to Skippy.

#10 @mdawaffe
18 years ago

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

Fixed some time ago. Relevant hooks:

wp_handle_upload

add_attachment

edit_attachment

Note: See TracTickets for help on using tickets.