[wp-trac] [WordPress Trac] #32965: Add new Credit field to media attachment details

WordPress Trac noreply at wordpress.org
Sun Jul 12 05:14:35 UTC 2015

#32965: Add new Credit field to media attachment details
 Reporter:  mcuomo2013   |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Media        |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
 I propose adding a new form field to the attachment details page to easily
 add information to credit media files to their original sources. For
 example, if I upload an image I can use this new field (Credit) to add the
 photographer and any other related or required information to fulfill
 copyright or attribution requirements. Currently the attachment details
 pane has the following fields (from Codex

         • Title: the name of this media
         • Caption: brief explanation - this text will be displayed below
 the image
         • Alternative text: text to describe the media - used for
         • Description: an explanation of this particular media

 These fields are not ideal for adding attribution information because
 doing so would prevent a user from adding information  originally intended
 for those fields. Having a separate field specifically for crediting an
 attachment would be better because users could still add a caption or
 description but also add their attribution. Plus, the Credit field could
 have a CSS class selector (e.g., "wp-credit-text") assigned to it to make
 it easy to style in a theme.

 '''Why this is important'''
 Whenever anyone inserts a media file into their post or page they should
 (or sometimes must) credit the original source. This is important to
 provide copyright information or to attribute items that are in the
 creative commons. Because there is currently no specific place to put this
 information on an attachment,  users might not be adding it or are doing
 so in an inconsistent or makeshift way (e.g., in the caption field or at
 the end of a post).

 When a user uploads a media file and sees the Credit field they may be
 more motivated to add the appropriate information, which can be as simple
 as the word "Credit" with a link to the original source to something more
 complex. For instance, the Creative Commons says an ideal attribution
 contains the following: title and author, as well as links to the original
 source, author's profile, and the Creative Commons license. For example:

         • "Creative Commons 10th Birthday Celebration San Francisco" by
 tvol is licensed under CC BY 2.0. See

 Although some plugins exist that add this feature and developers can add
 it to their functions file, it would be more beneficial as part of the
 WordPress Core. It would enhance WordPress for everyone, promote the idea
 of attributing work, and allow theme developers to easily add or style it
 in themes.

 Helpful things to note:
         • The Credit field should allow HTML
         • The magic happens in wp-admin/includes/media.php
         • Current attachment form fields are added in
 get_attachment_fields_to_edit() (line 1164)
         • WordPress creates a shortcode for the caption in
 img_caption_shortcode() (line 843) with <figcaption> tags and CSS class of
 "wp-caption-text" so we may want to do something similar to Credit, like
 <cite> tags and ".wp-credit-text" class.

 I've developed a small plugin that adds the field, but it needs a little
 work with styling for the attachment editor. See some more specific notes
 in the plugin.

 Thank you!

Ticket URL: <https://core.trac.wordpress.org/ticket/32965>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list