WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/06/2012 12:41:06 AM (9 years ago)
Author:
nacin
Message:

Restore the Description field to the media UI in 3.5.

We tried in vain -- a noble but ultimately failed effort -- to reduce the number of fields for attachments from four (title, caption, alt, description) to one (caption for images, title otherwise). Alternative text needed to stay for accessibility reasons, of course.

Eventually title returned due to heavy plugin reliance. Description is too used by too many plugins (often times incorrectly -- the caption is more likely the proper field), hence its less-than-triumphant return today.

Version 3.5 has tried to streamline media in a number of ways. Removing fields may have been too much at once, as it forced not only a user interface change, but a paradigm change as well.

Finally, on upload we populate the description field with IPTC/EXIF captions, rather than the caption field. See #22768, this should be fixed. For now, Description stays.

This commit also restores 'Title' attribute editing to the main tab of the Edit Image dialog. The "Title" field no longer populates title attributes for <img> tags by design (for accessibility and other purposes, see #18984). So, here is a more obvious 'workaround' for the tooltip community.

Finally, this:

  • Cleans up the post.php attachment editor, including by showing a prettier form of the mime type.
  • Enables plugins to specifically hide attachment_fields_to_edit from either post.php (where you can create meta boxes) or the modal (which you may not want to clutter), for compatibility reasons.
  • Hides the 'Describe this file...' placeholder when a field is read-only in the modal.

props nacin, helenyhou.
fixes #22759.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html

    r22948 r23083  
    7474        </tr>
    7575
     76        <tr>
     77            <th valign="top" scope="row" class="label">
     78                <label for="img_title">
     79                <span class="alignleft">{#wpeditimage.img_title}</span>
     80                </label>
     81            </th>
     82            <td class="field">
     83                <input type="text" id="img_title" name="img_title" value="" aria-required="true" size="60" />
     84            </td>
     85        </tr>
     86
     87        <tr>
     88            <th valign="top" scope="row" class="label">
     89                <label for="img_alt">
     90                <span class="alignleft">{#wpeditimage.alt}</span>
     91                </label>
     92            </th>
     93            <td class="field">
     94                <input type="text" id="img_alt" name="img_alt" value="" size="60" />
     95            </td>
     96        </tr>
     97
    7698        <tr id="cap_field">
    7799            <th valign="top" scope="row" class="label">
     
    82104            <td class="field">
    83105                <textarea id="img_cap_text"></textarea>
    84             </td>
    85         </tr>
    86 
    87         <tr>
    88             <th valign="top" scope="row" class="label">
    89                 <label for="img_alt">
    90                 <span class="alignleft">{#wpeditimage.alt}</span>
    91                 </label>
    92             </th>
    93             <td class="field">
    94                 <input type="text" id="img_alt" name="img_alt" value="" size="60" />
    95106            </td>
    96107        </tr>
     
    148159        <tr>
    149160            <th valign="top" scope="row" class="label">
    150                 <label for="img_title">
    151                 <span class="alignleft">{#wpeditimage.img_title}</span>
    152                 </label>
    153             </th>
    154             <td class="field">
    155                 <input type="text" id="img_title" name="img_title" value="" aria-required="true" size="60" />
    156             </td>
    157         </tr>
    158 
    159         <tr>
    160             <th valign="top" scope="row" class="label">
    161161                <label for="img_classes">
    162162                <span class="alignleft">{#wpeditimage.css}</span>
Note: See TracChangeset for help on using the changeset viewer.