Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to determine a way to access the meta data for an image when it is first uploaded with the media uploader.

Looking at the media_handle_upload() function in /wp-admin/includes/media.php I can't see any filters before the meta data is sent to wp_insert_attachment() wp_update_attachment_metadata().

Sure, I can filter the meta inside using the 'wp_update_attachment_metadata' filter. But this fires inside the wp_update_attachment_metadata() function.

I need a filter the meta data (specifically the title) when a new image is uploaded, not every time meta data is updated.

share|improve this question
add comment

1 Answer

You have to use add_attachment action.

I had a similar problem and I recently found your plugin: http://wordpress.org/extend/plugins/format-media-titles/

:-)

share|improve this answer
    
Yeah I figured it out and created a Plugin! :) –  dgwyer May 12 '12 at 18:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.