开发者

Do any plugins exist for WordPress that allow me to attach extra meta data to images?

From the media section in WordPress, I can see that I can edit

I need to add extra data, like shutter speed, location & film.

Short of something like title: "bla bla", shutterSpeed: "4" in the description field (and parsing it), is there any plugin that adds this functionality?

It should be easy enough for a laymen to enter data into.

Thanks!


WordPress will store any EXIF data it can retrieve at point-of-upload into the attachment metadata array (which is serialized in the postmeta table under the key _wp_attachment_metadata).

You can retrieve this metadata using wp_get_attachment_metadata($attachment_ID).

To add your own fields to the edit attachment form, check out get_attachment_fields_to_edit() in wp-admin/includes/media.php (line 1034 as of 3.0).

You can filter attachment_fields_to_edit, passing back a structured array like so;

function add_my_attachment_field($fields, $post)
{
    $fields['my_field'] = array(
        'label'      => 'My Label',
        'input'      => 'html',
        'html'       => "<input type='text' class='text' name='my_field' value='my_value' />",
        'value'      => 'my_value',
        'helps'      => 'Helper text'
    );
    return $fields;
 }
 add_filter('attachment_fields_to_edit', 'add_my_attachment_field', 10, 2);


NG Gallery can extract metadata from the EXIF data in the image and you have title/description fields as well

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜