Skip to main content
More descriptive title. Other minor adjustments.
Source Link
brasofilo
  • 22.1k
  • 8
  • 69
  • 264

Save othercamera info as metadata on image upload?

I am trying to have WordpressWordPress 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_contentpost_content and post_titlepost_title respectively.

I've found several examples of how to add custom attachment metadata fields AFTERafter 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_metaupdate_post_meta to save the "credit" line for the attachment.

Save other metadata on image upload?

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.

Save camera info as metadata on image upload?

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.

Tweeted twitter.com/#!/StackWordPress/status/313102657185280004
Code formatting, links to Codex
Source Link
s_ha_dum
  • 65.5k
  • 13
  • 84
  • 174

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()update_post_meta().

The "credit" information is gathered by wp_read_image_metadata()wp_read_image_metadata(), but media_handle_upload()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() 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.

Any advice would be greatly appreciated.

Thanks.

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.

Any advice would be greatly appreciated.

Thanks.

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.

Source Link
edeneye
  • 415
  • 5
  • 14

Save other metadata on image upload?

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.

Any advice would be greatly appreciated.

Thanks.