[wp-hackers] file post-uploading hook?

Jennifer Hodgdon yahgrp at poplarware.com
Mon Feb 19 16:22:38 GMT 2007


Amis/Pixline - Assistenza wrote [in part]:

> I'm working to port a complex website (with its own hand-made CMS) to 
> wordpress,[...]
> On the actual CMS we had a function to sanitize the file names and 
> manipulate uploaded files (like stripping spaces and not allowed chars, 
> converting all lowercase, and filling mp3 idv2 tags with the post meta 
> data); I'd love to port that function to wordpress, but I can't find any 
> hook to plug it with.

There is an action called 'upload_files_upload', which is called from 
upload.php for file upload management. You should be able to add to 
that, using add_action, with a high priority so your function is 
called first. See upload-functions.php in wp-admin for information on 
what it is doing now... if you have been writing plugins, this is 
probably enough to get you started?

Hope this helps --
     Jennifer


More information about the wp-hackers mailing list