I am trying to have WordPress automatically save the “credit” metadata that is stored within images I am uploading. I know this would be entered as a custom post meta field using update_post_meta().
The “credit” information is gathered by wp_read_image_metadata(), but media_handle_upload() doesn’t use it. It only uses the “caption” and “title” information gathered from the image for post_content and post_title respectively.
I’ve found several examples of how to add custom attachment metadata fields AFTER the upload when editing the image, but since WP is already gathering this information from the image’s metadata, I’d like to find a way to have it saved as the image is uploaded.
I’m unclear of what steps to take to hook into media_handle_upload() (there doesn’t seem to be a hook) so that I can call update_post_meta to save the “credit” line for the attachment.