0

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.

1 Answer 1

2

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/

:-)

1
  • Yeah I figured it out and created a Plugin! :)
    – dgwyer
    Commented May 12, 2012 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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