WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

Your Answer


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.