<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[23083] trunk: Restore the Description field to the media UI in 3.5.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/23083">23083</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2012-12-06 00:41:06 +0000 (Thu, 06 Dec 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>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 <a href="http://core.trac.wordpress.org/ticket/22768">#22768</a>, 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 &quot;Title&quot; field no longer populates title attributes for &lt;img&gt; tags by design (for accessibility and other purposes, see <a href="http://core.trac.wordpress.org/ticket/18984">#18984</a>). 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 <a href="http://core.trac.wordpress.org/ticket/22759">#22759</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincsswpadmincss">trunk/wp-admin/css/wp-admin.css</a></li>
<li><a href="#trunkwpadmineditformadvancedphp">trunk/wp-admin/edit-form-advanced.php</a></li>
<li><a href="#trunkwpadminincludesajaxactionsphp">trunk/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunkwpadminincludesmediaphp">trunk/wp-admin/includes/media.php</a></li>
<li><a href="#trunkwpadminincludesmetaboxesphp">trunk/wp-admin/includes/meta-boxes.php</a></li>
<li><a href="#trunkwpincludesjsmediaeditorjs">trunk/wp-includes/js/media-editor.js</a></li>
<li><a href="#trunkwpincludesjsmediaviewsjs">trunk/wp-includes/js/media-views.js</a></li>
<li><a href="#trunkwpincludesjstinymcepluginswpeditimageeditimagehtml">trunk/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html</a></li>
<li><a href="#trunkwpincludesmediaphp">trunk/wp-includes/media.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincsswpadmincss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/wp-admin.css (23082 => 23083)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/wp-admin.css        2012-12-05 22:51:24 UTC (rev 23082)
+++ trunk/wp-admin/css/wp-admin.css        2012-12-06 00:41:06 UTC (rev 23083)
</span><span class="lines">@@ -3407,6 +3407,10 @@
</span><span class="cx">         display: none;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#post-body-content .compat-attachment-fields {
+        margin-bottom: 20px;
+}
+
</ins><span class="cx"> .compat-attachment-fields th {
</span><span class="cx">         padding-top: 5px;
</span><span class="cx">         padding-right: 10px;
</span><span class="lines">@@ -4391,6 +4395,10 @@
</span><span class="cx">         padding: 2px 10px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.wp_attachment_details {
+        margin-bottom: 20px;
+}
+
</ins><span class="cx"> /*------------------------------------------------------------------------------
</span><span class="cx">   15.0 - Comments Screen
</span><span class="cx"> ------------------------------------------------------------------------------*/
</span></span></pre></div>
<a id="trunkwpadmineditformadvancedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-form-advanced.php (23082 => 23083)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-form-advanced.php        2012-12-05 22:51:24 UTC (rev 23082)
+++ trunk/wp-admin/edit-form-advanced.php        2012-12-06 00:41:06 UTC (rev 23083)
</span><span class="lines">@@ -107,7 +107,6 @@
</span><span class="cx">         wp_enqueue_script( 'image-edit' );
</span><span class="cx">         wp_enqueue_style( 'imgareaselect' );
</span><span class="cx">         add_meta_box( 'submitdiv', __('Save'), 'attachment_submit_meta_box', null, 'side', 'core' );
</span><del>-        add_meta_box( 'attachmentdata', __('Attachment Page Content'), 'attachment_content_meta_box', null, 'normal', 'core' );
</del><span class="cx">         add_action( 'edit_form_after_title', 'edit_form_image_editor' );
</span><span class="cx"> } else {
</span><span class="cx">         add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core' );
</span></span></pre></div>
<a id="trunkwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/ajax-actions.php (23082 => 23083)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/ajax-actions.php        2012-12-05 22:51:24 UTC (rev 23082)
+++ trunk/wp-admin/includes/ajax-actions.php        2012-12-06 00:41:06 UTC (rev 23083)
</span><span class="lines">@@ -1884,6 +1884,9 @@
</span><span class="cx">         if ( isset( $changes['caption'] ) )
</span><span class="cx">                 $post['post_excerpt'] = $changes['caption'];
</span><span class="cx"> 
</span><ins>+        if ( isset( $changes['description'] ) )
+                $post['post_content'] = $changes['description'];
+
</ins><span class="cx">         if ( isset( $changes['alt'] ) ) {
</span><span class="cx">                 $alt = get_post_meta( $id, '_wp_attachment_image_alt', true );
</span><span class="cx">                 $new_alt = stripslashes( $changes['alt'] );
</span><span class="lines">@@ -1923,10 +1926,6 @@
</span><span class="cx">         if ( 'attachment' != $post['post_type'] )
</span><span class="cx">                 wp_send_json_error();
</span><span class="cx"> 
</span><del>-        // Handle the description field automatically, if a plugin adds it back.
-        if ( isset( $attachment_data['post_content'] ) )
-                $post['post_content'] = $attachment_data['post_content'];
-
</del><span class="cx">         $post = apply_filters( 'attachment_fields_to_save', $post, $attachment_data );
</span><span class="cx"> 
</span><span class="cx">         if ( isset( $post['errors'] ) ) {
</span></span></pre></div>
<a id="trunkwpadminincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/media.php (23082 => 23083)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/media.php        2012-12-05 22:51:24 UTC (rev 23082)
+++ trunk/wp-admin/includes/media.php        2012-12-06 00:41:06 UTC (rev 23083)
</span><span class="lines">@@ -1286,8 +1286,7 @@
</span><span class="cx"> 
</span><span class="cx">         $default_args = array(
</span><span class="cx">                 'errors' =&gt; null,
</span><del>-                'taxonomies' =&gt; false,
-                'description' =&gt; false,
</del><ins>+                'in_modal' =&gt; false,
</ins><span class="cx">         );
</span><span class="cx"> 
</span><span class="cx">         $user_can_edit = current_user_can( 'edit_post', $attachment_id );
</span><span class="lines">@@ -1297,7 +1296,7 @@
</span><span class="cx"> 
</span><span class="cx">         $form_fields = array();
</span><span class="cx"> 
</span><del>-        if ( $args['taxonomies'] ) {
</del><ins>+        if ( $args['in_modal'] ) {
</ins><span class="cx">                 foreach ( get_attachment_taxonomies($post) as $taxonomy ) {
</span><span class="cx">                         $t = (array) get_taxonomy($taxonomy);
</span><span class="cx">                         if ( ! $t['public'] || ! $t['show_ui'] )
</span><span class="lines">@@ -1329,19 +1328,18 @@
</span><span class="cx">         $form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );
</span><span class="cx"> 
</span><span class="cx">         unset( $form_fields['image-size'], $form_fields['align'], $form_fields['image_alt'],
</span><del>-                $form_fields['post_title'], $form_fields['post_excerpt'],
</del><ins>+                $form_fields['post_title'], $form_fields['post_excerpt'], $form_fields['post_content'],
</ins><span class="cx">                 $form_fields['url'], $form_fields['menu_order'], $form_fields['image_url'] );
</span><span class="cx"> 
</span><del>-        if ( ! $args['description'] )
-                unset( $form_fields['post_content'] );
-
</del><span class="cx">         $media_meta = apply_filters( 'media_meta', '', $post );
</span><span class="cx"> 
</span><span class="cx">         $defaults = array(
</span><del>-                'input'      =&gt; 'text',
-                'required'   =&gt; false,
-                'value'      =&gt; '',
-                'extra_rows' =&gt; array(),
</del><ins>+                'input'         =&gt; 'text',
+                 'required'      =&gt; false,
+                 'value'         =&gt; '',
+                 'extra_rows'    =&gt; array(),
+                 'show_in_edit'  =&gt; true,
+                 'show_in_modal' =&gt; true,
</ins><span class="cx">         );
</span><span class="cx"> 
</span><span class="cx">         $hidden_fields = array();
</span><span class="lines">@@ -1361,6 +1359,9 @@
</span><span class="cx"> 
</span><span class="cx">                 $field = array_merge( $defaults, $field );
</span><span class="cx"> 
</span><ins>+                if ( ( ! $field['show_in_edit'] &amp;&amp; ! $args['in_modal'] ) || ( ! $field['show_in_modal'] &amp;&amp; $args['in_modal'] ) )
+                        continue;
+
</ins><span class="cx">                 if ( $field['input'] == 'hidden' ) {
</span><span class="cx">                         $hidden_fields[$name] = $field['value'];
</span><span class="cx">                         continue;
</span><span class="lines">@@ -2282,12 +2283,12 @@
</span><span class="cx"> 
</span><span class="cx">         $att_url = wp_get_attachment_url( $post-&gt;ID );
</span><span class="cx"> 
</span><del>-        $image_edit_button = '';
-        if ( wp_attachment_is_image( $post-&gt;ID ) &amp;&amp; wp_image_editor_supports( array( 'mime_type' =&gt; $post-&gt;post_mime_type ) ) ) {
-                $nonce = wp_create_nonce( &quot;image_editor-$post-&gt;ID&quot; );
-                $image_edit_button = &quot;&lt;input type='button' id='imgedit-open-btn-$post-&gt;ID' onclick='imageEdit.open( $post-&gt;ID, \&quot;$nonce\&quot; )' class='button' value='&quot; . esc_attr__( 'Edit Image' ) . &quot;' /&gt; &lt;span class='spinner'&gt;&lt;/span&gt;&quot;;
-        }
-
</del><ins>+        if ( wp_attachment_is_image( $post-&gt;ID ) ) :
+                $image_edit_button = '';
+                if ( wp_image_editor_supports( array( 'mime_type' =&gt; $post-&gt;post_mime_type ) ) ) {
+                        $nonce = wp_create_nonce( &quot;image_editor-$post-&gt;ID&quot; );
+                        $image_edit_button = &quot;&lt;input type='button' id='imgedit-open-btn-$post-&gt;ID' onclick='imageEdit.open( $post-&gt;ID, \&quot;$nonce\&quot; )' class='button' value='&quot; . esc_attr__( 'Edit Image' ) . &quot;' /&gt; &lt;span class='spinner'&gt;&lt;/span&gt;&quot;;
+                }
</ins><span class="cx">          ?&gt;
</span><span class="cx">         &lt;div class=&quot;wp_attachment_holder&quot;&gt;
</span><span class="cx">                 &lt;div class=&quot;imgedit-response&quot; id=&quot;imgedit-response-&lt;?php echo $attachment_id; ?&gt;&quot;&gt;&lt;/div&gt;
</span><span class="lines">@@ -2298,6 +2299,7 @@
</span><span class="cx">                 &lt;/div&gt;
</span><span class="cx">                 &lt;div style=&quot;display:none&quot; class=&quot;image-editor&quot; id=&quot;image-editor-&lt;?php echo $attachment_id; ?&gt;&quot;&gt;&lt;/div&gt;
</span><span class="cx">         &lt;/div&gt;
</span><ins>+        &lt;?php endif; ?&gt;
</ins><span class="cx"> 
</span><span class="cx">         &lt;div class=&quot;wp_attachment_details&quot;&gt;
</span><span class="cx">                 &lt;p&gt;
</span><span class="lines">@@ -2312,6 +2314,20 @@
</span><span class="cx">                 &lt;/p&gt;
</span><span class="cx">         &lt;?php endif; ?&gt;
</span><span class="cx"> 
</span><ins>+        &lt;?php
+                $quicktags_settings = array( 'buttons' =&gt; 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' );
+                $editor_args = array(
+                        'textarea_name' =&gt; 'content',
+                        'textarea_rows' =&gt; 5,
+                        'media_buttons' =&gt; false,
+                        'tinymce' =&gt; false,
+                        'quicktags' =&gt; $quicktags_settings,
+                );
+        ?&gt;
+
+        &lt;label for=&quot;content&quot;&gt;&lt;strong&gt;&lt;?php _e( 'Description' ); ?&gt;&lt;/strong&gt;&lt;/label&gt;
+        &lt;?php wp_editor( $post-&gt;post_content, 'attachment_content', $editor_args ); ?&gt;
+
</ins><span class="cx">         &lt;/div&gt;
</span><span class="cx">         &lt;?php
</span><span class="cx">         $extras = get_compat_media_markup( $post-&gt;ID );
</span><span class="lines">@@ -2348,7 +2364,12 @@
</span><span class="cx">                 &lt;?php _e( 'File name:' ); ?&gt; &lt;strong&gt;&lt;?php echo $filename; ?&gt;&lt;/strong&gt;
</span><span class="cx">         &lt;/div&gt;
</span><span class="cx">         &lt;div class=&quot;misc-pub-section&quot;&gt;
</span><del>-                &lt;?php _e( 'File type:' ); ?&gt; &lt;strong&gt;&lt;?php echo $post-&gt;post_mime_type; ?&gt;&lt;/strong&gt;
</del><ins>+                &lt;?php _e( 'File type:' ); ?&gt; &lt;strong&gt;&lt;?php
+                        if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post-&gt;ID ), $matches ) )
+                                echo esc_html( strtoupper( $matches[1] ) );
+                        else
+                                echo strtoupper( str_replace( 'image/', '', $post-&gt;post_mime_type ) );
+                ?&gt;&lt;/strong&gt;
</ins><span class="cx">         &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;?php if ( $media_dims ) : ?&gt;
</span></span></pre></div>
<a id="trunkwpadminincludesmetaboxesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/meta-boxes.php (23082 => 23083)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/meta-boxes.php        2012-12-05 22:51:24 UTC (rev 23082)
+++ trunk/wp-admin/includes/meta-boxes.php        2012-12-06 00:41:06 UTC (rev 23083)
</span><span class="lines">@@ -296,30 +296,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- * Display attachment/media-specific information
- *
- * @since 3.5.0
- *
- * @param object $post
- */
-function attachment_content_meta_box( $post ) {
-        $quicktags_settings = array( 'buttons' =&gt; 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' );
-        $editor_args = array(
-                'textarea_name' =&gt; 'content',
-                'textarea_rows' =&gt; 5,
-                'media_buttons' =&gt; false,
-                'tinymce' =&gt; false,
-                'quicktags' =&gt; $quicktags_settings,
-        );
-?&gt;
-&lt;p&gt;
-        &lt;label class=&quot;screen-reader-text&quot; for=&quot;content&quot;&gt;&lt;strong&gt;&lt;?php _e( 'Attachment Page Content' ); ?&gt;&lt;/strong&gt;&lt;/label&gt;
-        &lt;?php wp_editor( $post-&gt;post_content, 'attachment_content', $editor_args ); ?&gt;
-&lt;/p&gt;
-&lt;?php
-}
-
-/**
</del><span class="cx">  * Display post format form elements.
</span><span class="cx">  *
</span><span class="cx">  * @since 3.1.0
</span></span></pre></div>
<a id="trunkwpincludesjsmediaeditorjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/media-editor.js (23082 => 23083)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/media-editor.js        2012-12-05 22:51:24 UTC (rev 23082)
+++ trunk/wp-includes/js/media-editor.js        2012-12-06 00:41:06 UTC (rev 23083)
</span><span class="lines">@@ -554,7 +554,8 @@
</span><span class="cx">                                 props = wp.media.string.props( props, attachment );
</span><span class="cx"> 
</span><span class="cx">                                 options = {
</span><del>-                                        id: attachment.id
</del><ins>+                                        id:           attachment.id,
+                                        post_content: attachment.description
</ins><span class="cx">                                 };
</span><span class="cx"> 
</span><span class="cx">                                 if ( props.linkUrl )
</span></span></pre></div>
<a id="trunkwpincludesjsmediaviewsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/media-views.js (23082 => 23083)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/media-views.js        2012-12-05 22:51:24 UTC (rev 23082)
+++ trunk/wp-includes/js/media-views.js        2012-12-06 00:41:06 UTC (rev 23083)
</span><span class="lines">@@ -2829,7 +2829,8 @@
</span><span class="cx">                                         width:         '',
</span><span class="cx">                                         height:        '',
</span><span class="cx">                                         compat:        false,
</span><del>-                                        alt:           ''
</del><ins>+                                        alt:           '',
+                                        description:   '',
</ins><span class="cx">                                 });
</span><span class="cx"> 
</span><span class="cx">                         options.buttons  = this.buttons;
</span></span></pre></div>
<a id="trunkwpincludesjstinymcepluginswpeditimageeditimagehtml"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html (23082 => 23083)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html        2012-12-05 22:51:24 UTC (rev 23082)
+++ trunk/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html        2012-12-06 00:41:06 UTC (rev 23083)
</span><span class="lines">@@ -73,14 +73,14 @@
</span><span class="cx">                         &lt;/td&gt;
</span><span class="cx">                 &lt;/tr&gt;
</span><span class="cx"> 
</span><del>-                &lt;tr id=&quot;cap_field&quot;&gt;
</del><ins>+                &lt;tr&gt;
</ins><span class="cx">                         &lt;th valign=&quot;top&quot; scope=&quot;row&quot; class=&quot;label&quot;&gt;
</span><del>-                                &lt;label for=&quot;img_cap&quot;&gt;
-                                &lt;span class=&quot;alignleft&quot;&gt;{#wpeditimage.caption}&lt;/span&gt;
</del><ins>+                                &lt;label for=&quot;img_title&quot;&gt;
+                                &lt;span class=&quot;alignleft&quot;&gt;{#wpeditimage.img_title}&lt;/span&gt;
</ins><span class="cx">                                 &lt;/label&gt;
</span><span class="cx">                         &lt;/th&gt;
</span><span class="cx">                         &lt;td class=&quot;field&quot;&gt;
</span><del>-                                &lt;textarea id=&quot;img_cap_text&quot;&gt;&lt;/textarea&gt;
</del><ins>+                                &lt;input type=&quot;text&quot; id=&quot;img_title&quot; name=&quot;img_title&quot; value=&quot;&quot; aria-required=&quot;true&quot; size=&quot;60&quot; /&gt;
</ins><span class="cx">                         &lt;/td&gt;
</span><span class="cx">                 &lt;/tr&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -95,6 +95,17 @@
</span><span class="cx">                         &lt;/td&gt;
</span><span class="cx">                 &lt;/tr&gt;
</span><span class="cx"> 
</span><ins>+                &lt;tr id=&quot;cap_field&quot;&gt;
+                        &lt;th valign=&quot;top&quot; scope=&quot;row&quot; class=&quot;label&quot;&gt;
+                                &lt;label for=&quot;img_cap&quot;&gt;
+                                &lt;span class=&quot;alignleft&quot;&gt;{#wpeditimage.caption}&lt;/span&gt;
+                                &lt;/label&gt;
+                        &lt;/th&gt;
+                        &lt;td class=&quot;field&quot;&gt;
+                                &lt;textarea id=&quot;img_cap_text&quot;&gt;&lt;/textarea&gt;
+                        &lt;/td&gt;
+                &lt;/tr&gt;
+
</ins><span class="cx">                 &lt;tr&gt;
</span><span class="cx">                         &lt;th valign=&quot;top&quot; scope=&quot;row&quot; class=&quot;label&quot;&gt;
</span><span class="cx">                                 &lt;label for=&quot;link_href&quot;&gt;
</span><span class="lines">@@ -147,17 +158,6 @@
</span><span class="cx"> 
</span><span class="cx">                 &lt;tr&gt;
</span><span class="cx">                         &lt;th valign=&quot;top&quot; scope=&quot;row&quot; class=&quot;label&quot;&gt;
</span><del>-                                &lt;label for=&quot;img_title&quot;&gt;
-                                &lt;span class=&quot;alignleft&quot;&gt;{#wpeditimage.img_title}&lt;/span&gt;
-                                &lt;/label&gt;
-                        &lt;/th&gt;
-                        &lt;td class=&quot;field&quot;&gt;
-                                &lt;input type=&quot;text&quot; id=&quot;img_title&quot; name=&quot;img_title&quot; value=&quot;&quot; aria-required=&quot;true&quot; size=&quot;60&quot; /&gt;
-                        &lt;/td&gt;
-                &lt;/tr&gt;
-
-                &lt;tr&gt;
-                        &lt;th valign=&quot;top&quot; scope=&quot;row&quot; class=&quot;label&quot;&gt;
</del><span class="cx">                                 &lt;label for=&quot;img_classes&quot;&gt;
</span><span class="cx">                                 &lt;span class=&quot;alignleft&quot;&gt;{#wpeditimage.css}&lt;/span&gt;
</span><span class="cx">                                 &lt;/label&gt;
</span></span></pre></div>
<a id="trunkwpincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/media.php (23082 => 23083)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/media.php        2012-12-05 22:51:24 UTC (rev 23082)
+++ trunk/wp-includes/media.php        2012-12-06 00:41:06 UTC (rev 23083)
</span><span class="lines">@@ -1395,7 +1395,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if ( function_exists('get_compat_media_markup') )
</span><del>-                $response['compat'] = get_compat_media_markup( $attachment-&gt;ID, array( 'taxonomies' =&gt; true, 'description' =&gt; true ) );
</del><ins>+                $response['compat'] = get_compat_media_markup( $attachment-&gt;ID, array( 'in_modal' =&gt; true ) );
</ins><span class="cx"> 
</span><span class="cx">         return apply_filters( 'wp_prepare_attachment_for_js', $response, $attachment, $meta );
</span><span class="cx"> }
</span><span class="lines">@@ -1740,15 +1740,22 @@
</span><span class="cx">                         &lt;label class=&quot;setting&quot; data-setting=&quot;title&quot;&gt;
</span><span class="cx">                                 &lt;span&gt;&lt;?php _e('Title'); ?&gt;&lt;/span&gt;
</span><span class="cx">                                 &lt;input type=&quot;text&quot; value=&quot;{{ data.title }}&quot; {{ maybeReadOnly }}
</span><del>-                                &lt;# if ( 'video' === data.type ) { #&gt;
-                                        placeholder=&quot;&lt;?php esc_attr_e('Describe this video&amp;hellip;'); ?&gt;&quot;
-                                &lt;# } else if ( 'audio' === data.type ) { #&gt;
-                                        placeholder=&quot;&lt;?php esc_attr_e('Describe this audio file&amp;hellip;'); ?&gt;&quot;
-                                &lt;# } else { #&gt;
-                                        placeholder=&quot;&lt;?php esc_attr_e('Describe this media file&amp;hellip;'); ?&gt;&quot;
-                                &lt;# } #&gt;/&gt;
</del><ins>+                                &lt;# if ( ! maybeReadOnly ) { #&gt;
+                                        &lt;# if ( 'video' === data.type ) { #&gt;
+                                                placeholder=&quot;&lt;?php esc_attr_e('Describe this video&amp;hellip;'); ?&gt;&quot;
+                                        &lt;# } else if ( 'audio' === data.type ) { #&gt;
+                                                placeholder=&quot;&lt;?php esc_attr_e('Describe this audio file&amp;hellip;'); ?&gt;&quot;
+                                        &lt;# } else { #&gt;
+                                                placeholder=&quot;&lt;?php esc_attr_e('Describe this media file&amp;hellip;'); ?&gt;&quot;
+                                        &lt;# } #&gt;
+                                &lt;# } #&gt;
+                                /&gt;
</ins><span class="cx">                         &lt;/label&gt;
</span><span class="cx">                 &lt;# } #&gt;
</span><ins>+                        &lt;label class=&quot;setting&quot; data-setting=&quot;description&quot;&gt;
+                                &lt;span&gt;&lt;?php _e('Description'); ?&gt;&lt;/span&gt;
+                                &lt;textarea {{ maybeReadOnly }}&gt;{{ data.description }}&lt;/textarea&gt;
+                        &lt;/label&gt;
</ins><span class="cx">         &lt;/script&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;script type=&quot;text/html&quot; id=&quot;tmpl-media-selection&quot;&gt;
</span></span></pre>
</div>
</div>

</body>
</html>