<!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>[22532] trunk: Media: Add title, caption, and alt text, and attachment info to sidebar.</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/22532">22532</a></dd>
<dt>Author</dt> <dd>koopersmith</dd>
<dt>Date</dt> <dd>2012-11-10 18:25:04 +0000 (Sat, 10 Nov 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Media: Add title, caption, and alt text, and attachment info to sidebar.

* Improve sidebar styles.
* Separate the hybrid title/caption field.
* Improve the sidebar image thumbnail.
* Remove filenames from inside the non-image icon thumbnail.
* Properly sync title/caption/alt.

see <a href="http://core.trac.wordpress.org/ticket/21390">#21390</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesajaxactionsphp">trunk/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunkwpadminincludespostphp">trunk/wp-admin/includes/post.php</a></li>
<li><a href="#trunkwpincludescssmediaviewscss">trunk/wp-includes/css/media-views.css</a></li>
<li><a href="#trunkwpincludesjsmediaviewsjs">trunk/wp-includes/js/media-views.js</a></li>
<li><a href="#trunkwpincludesmediaphp">trunk/wp-includes/media.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/ajax-actions.php (22531 => 22532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/ajax-actions.php        2012-11-10 18:13:09 UTC (rev 22531)
+++ trunk/wp-admin/includes/ajax-actions.php        2012-11-10 18:25:04 UTC (rev 22532)
</span><span class="lines">@@ -1858,8 +1858,11 @@
</span><span class="cx">         if ( ! empty( $changes['caption'] ) )
</span><span class="cx">                 $args['post_excerpt'] = $changes['caption'];
</span><span class="cx"> 
</span><ins>+        if ( ! empty( $changes['alt'] ) )
+                $args['_wp_attachment_image_alt'] = $changes['alt'];
+
</ins><span class="cx">         if ( $args )
</span><del>-                wp_update_post( array_merge( $args, array( 'ID' =&gt; $id ) ) );
</del><ins>+                edit_post( array_merge( $args, array( 'post_ID' =&gt; $id ) ) );
</ins><span class="cx"> 
</span><span class="cx">         wp_send_json_success();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpadminincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/post.php (22531 => 22532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/post.php        2012-11-10 18:13:09 UTC (rev 22531)
+++ trunk/wp-admin/includes/post.php        2012-11-10 18:25:04 UTC (rev 22532)
</span><span class="lines">@@ -165,8 +165,9 @@
</span><span class="cx">         $post_data = _wp_translate_postdata( true, $post_data );
</span><span class="cx">         if ( is_wp_error($post_data) )
</span><span class="cx">                 wp_die( $post_data-&gt;get_error_message() );
</span><del>-        if ( 'autosave' != $post_data['action'] &amp;&amp; 'auto-draft' == $post_data['post_status'] )
</del><ins>+        if ( ( empty( $post_data['action'] ) || 'autosave' != $post_data['action'] ) &amp;&amp; 'auto-draft' == $post_data['post_status'] ) {
</ins><span class="cx">                 $post_data['post_status'] = 'draft';
</span><ins>+        }
</ins><span class="cx"> 
</span><span class="cx">         if ( isset($post_data['visibility']) ) {
</span><span class="cx">                 switch ( $post_data['visibility'] ) {
</span></span></pre></div>
<a id="trunkwpincludescssmediaviewscss"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/css/media-views.css (22531 => 22532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/css/media-views.css        2012-11-10 18:13:09 UTC (rev 22531)
+++ trunk/wp-includes/css/media-views.css        2012-11-10 18:25:04 UTC (rev 22532)
</span><span class="lines">@@ -171,6 +171,70 @@
</span><span class="cx">         padding-top: 5px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.media-sidebar h3 {
+        position: relative;
+        font-weight: bold;
+        text-transform: uppercase;
+        font-size: 12px;
+        color: #777;
+        text-shadow: 0 1px 0 #fff;
+        margin: 24px 0 8px;
+}
+
+/*.media-sidebar h3:before {
+        content: '\25B8';
+        display: block;
+        position: absolute;
+        top: -1px;
+        left: -12px;
+        font-size: 14px;
+        color: #ccc;
+}
+*/
+.media-sidebar .setting {
+        display: block;
+        float: left;
+        width: 100%;
+        margin: 1px 0;
+}
+
+.media-sidebar .setting span {
+        float: left;
+        min-width: 78px;
+        min-height: 24px;
+        margin-right: 7px;
+        padding-top: 8px;
+        line-height: 16px;
+        text-align: right;
+        color: #999;
+        text-shadow: 0 1px 0 #fff;
+}
+
+.media-sidebar .setting input,
+.media-sidebar .setting textarea,
+.media-sidebar .setting &gt; .button-group {
+        min-width: 180px;
+        float: right;
+}
+
+.media-sidebar .setting input,
+.media-sidebar .setting textarea {
+        padding: 6px 8px;
+        line-height: 16px;
+        resize: none;
+}
+
+.media-sidebar .setting textarea {
+        height: 62px;
+}
+
+.media-sidebar .setting select {
+        height: 28px;
+        line-height: 28px;
+        margin-top: 3px;
+}
+
+
</ins><span class="cx"> /**
</span><span class="cx">  * Menu
</span><span class="cx">  */
</span><span class="lines">@@ -787,22 +851,31 @@
</span><span class="cx">         overflow: auto;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.attachment-details-preview {
-        cursor: default;
</del><ins>+.attachment-info {
+        overflow: hidden;
+        min-height: 60px;
+        margin-bottom: 16px;
+        line-height: 18px;
+        color: #999;
+        border-bottom: 1px solid #e5e5e5;
+        box-shadow: 0 1px 0 #fff;
+        padding-bottom: 16px;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-.attachment-details-preview {
-        width: auto;
-        height: auto;
-        position: relative;
</del><ins>+.attachment-info .filename {
+        font-weight: bold;
+        color: #464646;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-.attachment-details-preview .thumbnail {
-        width: 100%;
-        height: auto;
</del><ins>+.attachment-info .thumbnail {
+        position: relative;
+        float: left;
+        max-width: 120px;
+        max-height: 120px;
+        margin-right: 10px;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-.attachment-details-preview .thumbnail:after {
</del><ins>+.attachment-info .thumbnail:after {
</ins><span class="cx">         content: '';
</span><span class="cx">         display: block;
</span><span class="cx">         position: absolute;
</span><span class="lines">@@ -810,21 +883,19 @@
</span><span class="cx">         left: 0;
</span><span class="cx">         right: 0;
</span><span class="cx">         bottom: 0;
</span><del>-        box-shadow: inset 0 0 0 1px rgba( 0, 0, 0, 0.1 );
</del><ins>+        box-shadow: inset 0 0 0 1px rgba( 0, 0, 0, 0.15 );
</ins><span class="cx">         overflow: hidden;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.attachment-details-preview .thumbnail img {
</del><ins>+.attachment-info .thumbnail img {
</ins><span class="cx">         display: block;
</span><del>-        max-width: 100%;
-        max-height: 132px;
</del><ins>+        max-width: 120px;
+        max-height: 120px;
</ins><span class="cx">         margin: 0 auto;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.attachment-details .describe {
</del><ins>+.attachment-info .details {
</ins><span class="cx">         float: left;
</span><del>-        margin: 10px 0 0;
-        border-radius: 3px;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -833,4 +904,8 @@
</span><span class="cx"> 
</span><span class="cx"> .attachment-display-settings h4 {
</span><span class="cx">         margin: 1.4em 0 0.4em;
</span><ins>+}
+
+.gallery-settings {
+        overflow: hidden;
</ins><span class="cx"> }
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjsmediaviewsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/media-views.js (22531 => 22532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/media-views.js        2012-11-10 18:13:09 UTC (rev 22531)
+++ trunk/wp-includes/js/media-views.js        2012-11-10 18:25:04 UTC (rev 22532)
</span><span class="lines">@@ -1906,8 +1906,11 @@
</span><span class="cx">                 template:  media.template('attachment'),
</span><span class="cx"> 
</span><span class="cx">                 events: {
</span><del>-                        'mousedown .attachment-preview': 'toggleSelection',
-                        'change .describe':          'describe'
</del><ins>+                        'mousedown .attachment-preview':  'toggleSelection',
+                        'change [data-setting]':          'updateSetting',
+                        'change [data-setting] input':    'updateSetting',
+                        'change [data-setting] select':   'updateSetting',
+                        'change [data-setting] textarea': 'updateSetting'
</ins><span class="cx">                 },
</span><span class="cx"> 
</span><span class="cx">                 buttons: {},
</span><span class="lines">@@ -2039,11 +2042,13 @@
</span><span class="cx">                         }
</span><span class="cx">                 },
</span><span class="cx"> 
</span><del>-                describe: function( event ) {
-                        if ( 'image' === this.model.get('type') )
-                                this.model.save( 'caption', event.target.value );
-                        else
-                                this.model.save( 'title', event.target.value );
</del><ins>+                updateSetting: function( event ) {
+                        var $setting = $( event.target ).closest('[data-setting]');
+
+                        if ( ! $setting.length )
+                                return;
+
+                        this.model.save( $setting.data('setting'), event.target.value );
</ins><span class="cx">                 }
</span><span class="cx">         });
</span><span class="cx"> 
</span><span class="lines">@@ -2592,7 +2597,10 @@
</span><span class="cx">                 template:  media.template('attachment-details'),
</span><span class="cx"> 
</span><span class="cx">                 events: {
</span><del>-                        'change .describe': 'describe'
</del><ins>+                        'change [data-setting]':          'updateSetting',
+                        'change [data-setting] input':    'updateSetting',
+                        'change [data-setting] select':   'updateSetting',
+                        'change [data-setting] textarea': 'updateSetting'
</ins><span class="cx">                 }
</span><span class="cx">         });
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/media.php (22531 => 22532)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/media.php        2012-11-10 18:13:09 UTC (rev 22531)
+++ trunk/wp-includes/media.php        2012-11-10 18:25:04 UTC (rev 22532)
</span><span class="lines">@@ -1262,6 +1262,7 @@
</span><span class="cx">                 'type'        =&gt; $type,
</span><span class="cx">                 'subtype'     =&gt; $subtype,
</span><span class="cx">                 'icon'        =&gt; wp_mime_type_icon( $attachment-&gt;ID ),
</span><ins>+                'dateFormatted' =&gt; mysql2date( get_option('date_format'), $attachment-&gt;post_date ),
</ins><span class="cx">         );
</span><span class="cx"> 
</span><span class="cx">         if ( $meta &amp;&amp; 'image' === $type ) {
</span><span class="lines">@@ -1436,36 +1437,53 @@
</span><span class="cx">         &lt;/script&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;script type=&quot;text/html&quot; id=&quot;tmpl-attachment-details&quot;&gt;
</span><del>-                &lt;h3&gt;&lt;?php _e('Edit Attachment Details'); ?&gt;&lt;/h3&gt;
-                &lt;div class=&quot;attachment-preview attachment-details-preview type-{{ type }} subtype-{{ subtype }} {{ orientation }}&quot;&gt;
-                        &lt;# if ( uploading ) { #&gt;
-                                &lt;div class=&quot;media-progress-bar&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;
-                        &lt;# } else if ( 'image' === type ) { #&gt;
-                                &lt;div class=&quot;thumbnail&quot;&gt;
</del><ins>+                &lt;h3&gt;&lt;?php _e('Attachment Details'); ?&gt;&lt;/h3&gt;
+                &lt;div class=&quot;attachment-info&quot;&gt;
+                        &lt;div class=&quot;thumbnail&quot;&gt;
+                                &lt;# if ( uploading ) { #&gt;
+                                        &lt;div class=&quot;media-progress-bar&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;
+                                &lt;# } else if ( 'image' === type ) { #&gt;
</ins><span class="cx">                                         &lt;img src=&quot;{{ url }}&quot; draggable=&quot;false&quot; /&gt;
</span><del>-                                &lt;/div&gt;
-                        &lt;# } else { #&gt;
-                                &lt;div class=&quot;icon-thumbnail&quot;&gt;
</del><ins>+                                &lt;# } else { #&gt;
</ins><span class="cx">                                         &lt;img src=&quot;{{ icon }}&quot; class=&quot;icon&quot; draggable=&quot;false&quot; /&gt;
</span><del>-                                        &lt;div class=&quot;filename&quot;&gt;{{ filename }}&lt;/div&gt;
-                                &lt;/div&gt;
-                        &lt;# } #&gt;
</del><ins>+                                &lt;# } #&gt;
+                        &lt;/div&gt;
+                        &lt;div class=&quot;details&quot;&gt;
+                                &lt;div class=&quot;filename&quot;&gt;{{ filename }}&lt;/div&gt;
+                                &lt;div class=&quot;uploaded&quot;&gt;{{ dateFormatted }}&lt;/div&gt;
+                                &lt;# if ( 'image' === type ) { #&gt;
+                                        &lt;div class=&quot;dimensions&quot;&gt;{{ width }} &amp;times; {{ height }}&lt;/div&gt;
+                                &lt;# } #&gt;
+                        &lt;/div&gt;
</ins><span class="cx">                 &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx">                 &lt;# if ( 'image' === type ) { #&gt;
</span><del>-                        &lt;textarea class=&quot;describe&quot;
-                                placeholder=&quot;&lt;?php esc_attr_e('Describe this image&amp;hellip;'); ?&gt;&quot;
-                                &gt;{{ caption }}&lt;/textarea&gt;
</del><ins>+                        &lt;label class=&quot;setting&quot; data-setting=&quot;title&quot;&gt;
+                                &lt;span&gt;&lt;?php _e('Title'); ?&gt;&lt;/span&gt;
+                                &lt;input type=&quot;text&quot; value=&quot;{{ title }}&quot; /&gt;
+                        &lt;/label&gt;
+                        &lt;label class=&quot;setting&quot; data-setting=&quot;caption&quot;&gt;
+                                &lt;span&gt;&lt;?php _e('Caption'); ?&gt;&lt;/span&gt;
+                                &lt;textarea
+                                        placeholder=&quot;&lt;?php esc_attr_e('Describe this image&amp;hellip;'); ?&gt;&quot;
+                                        &gt;{{ caption }}&lt;/textarea&gt;
+                        &lt;/label&gt;
+                        &lt;label class=&quot;setting&quot; data-setting=&quot;alt&quot;&gt;
+                                &lt;span&gt;&lt;?php _e('Alt Text'); ?&gt;&lt;/span&gt;
+                                &lt;input type=&quot;text&quot; value=&quot;{{ alt }}&quot; /&gt;
+                        &lt;/label&gt;
</ins><span class="cx">                 &lt;# } else { #&gt;
</span><del>-                        &lt;textarea class=&quot;describe&quot;
</del><ins>+                        &lt;label class=&quot;setting&quot; data-setting=&quot;title&quot;&gt;
+                                &lt;span&gt;&lt;?php _e('Title'); ?&gt;&lt;/span&gt;
+                                &lt;input type=&quot;text&quot; value=&quot;{{ title }}&quot;
</ins><span class="cx">                                 &lt;# if ( 'video' === type ) { #&gt;
</span><span class="cx">                                         placeholder=&quot;&lt;?php esc_attr_e('Describe this video&amp;hellip;'); ?&gt;&quot;
</span><span class="cx">                                 &lt;# } else if ( 'audio' === type ) { #&gt;
</span><span class="cx">                                         placeholder=&quot;&lt;?php esc_attr_e('Describe this audio file&amp;hellip;'); ?&gt;&quot;
</span><span class="cx">                                 &lt;# } else { #&gt;
</span><span class="cx">                                         placeholder=&quot;&lt;?php esc_attr_e('Describe this media file&amp;hellip;'); ?&gt;&quot;
</span><del>-                                &lt;# } #&gt;
-                                &gt;{{ title }}&lt;/textarea&gt;
</del><ins>+                                &lt;# } #&gt;/&gt;
+                        &lt;/label&gt;
</ins><span class="cx">                 &lt;# } #&gt;
</span><span class="cx">         &lt;/script&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -1495,100 +1513,112 @@
</span><span class="cx">         &lt;script type=&quot;text/html&quot; id=&quot;tmpl-attachment-display-settings&quot;&gt;
</span><span class="cx">                 &lt;h3&gt;&lt;?php _e('Attachment Display Settings'); ?&gt;&lt;/h3&gt;
</span><span class="cx"> 
</span><del>-                &lt;h4&gt;&lt;?php _e('Alignment'); ?&gt;&lt;/h4&gt;
-                &lt;div class=&quot;alignment button-group button-large&quot;
-                        data-setting=&quot;align&quot;
-                        &lt;# if ( userSettings ) { #&gt;
-                                data-user-setting=&quot;align&quot;
-                        &lt;# } #&gt;&gt;
</del><ins>+                &lt;label class=&quot;setting&quot;&gt;
+                        &lt;span&gt;&lt;?php _e('Alignment'); ?&gt;&lt;/span&gt;
+                        &lt;select class=&quot;alignment&quot;
+                                data-setting=&quot;align&quot;
+                                &lt;# if ( userSettings ) { #&gt;
+                                        data-user-setting=&quot;align&quot;
+                                &lt;# } #&gt;&gt;
</ins><span class="cx"> 
</span><del>-                        &lt;button class=&quot;button&quot; value=&quot;left&quot;&gt;
-                                &lt;?php esc_attr_e('Left'); ?&gt;
-                        &lt;/button&gt;
-                        &lt;button class=&quot;button&quot; value=&quot;center&quot;&gt;
-                                &lt;?php esc_attr_e('Center'); ?&gt;
-                        &lt;/button&gt;
-                        &lt;button class=&quot;button&quot; value=&quot;right&quot;&gt;
-                                &lt;?php esc_attr_e('Right'); ?&gt;
-                        &lt;/button&gt;
-                        &lt;button class=&quot;button active&quot; value=&quot;none&quot;&gt;
-                                &lt;?php esc_attr_e('None'); ?&gt;
-                        &lt;/button&gt;
-                &lt;/div&gt;
</del><ins>+                                &lt;option value=&quot;left&quot;&gt;
+                                        &lt;?php esc_attr_e('Left'); ?&gt;
+                                &lt;/option&gt;
+                                &lt;option value=&quot;center&quot;&gt;
+                                        &lt;?php esc_attr_e('Center'); ?&gt;
+                                &lt;/option&gt;
+                                &lt;option value=&quot;right&quot;&gt;
+                                        &lt;?php esc_attr_e('Right'); ?&gt;
+                                &lt;/option&gt;
+                                &lt;option value=&quot;none&quot; selected&gt;
+                                        &lt;?php esc_attr_e('None'); ?&gt;
+                                &lt;/option&gt;
+                        &lt;/select&gt;
+                &lt;/label&gt;
</ins><span class="cx"> 
</span><del>-                &lt;h4&gt;&lt;?php _e('Link To'); ?&gt;&lt;/h4&gt;
-                &lt;div class=&quot;link-to button-group button-large&quot;
-                        data-setting=&quot;link&quot;
-                        &lt;# if ( userSettings ) { #&gt;
-                                data-user-setting=&quot;urlbutton&quot;
-                        &lt;# } #&gt;&gt;
-
-                        &lt;button class=&quot;button active&quot; value=&quot;post&quot;&gt;
-                                &lt;?php esc_attr_e('Attachment Page'); ?&gt;
-                        &lt;/button&gt;
-                        &lt;button class=&quot;button&quot; value=&quot;file&quot;&gt;
-                                &lt;?php esc_attr_e('Media File'); ?&gt;
-                        &lt;/button&gt;
-                        &lt;button class=&quot;button&quot; value=&quot;none&quot;&gt;
-                                &lt;?php esc_attr_e('None'); ?&gt;
-                        &lt;/button&gt;
-                &lt;/div&gt;
-
-                &lt;# if ( ! _.isUndefined( sizes ) ) { #&gt;
-                        &lt;h4&gt;&lt;?php _e('Size'); ?&gt;&lt;/h4&gt;
-                        &lt;select class=&quot;size&quot; name=&quot;size&quot;
-                                data-setting=&quot;size&quot;
</del><ins>+                &lt;label class=&quot;setting&quot;&gt;
+                        &lt;span&gt;&lt;?php _e('Link To'); ?&gt;&lt;/span&gt;
+                        &lt;select class=&quot;link-to&quot;
+                                data-setting=&quot;link&quot;
</ins><span class="cx">                                 &lt;# if ( userSettings ) { #&gt;
</span><del>-                                        data-user-setting=&quot;imgsize&quot;
</del><ins>+                                        data-user-setting=&quot;urlbutton&quot;
</ins><span class="cx">                                 &lt;# } #&gt;&gt;
</span><del>-                                &lt;?php
</del><span class="cx"> 
</span><del>-                                $sizes = apply_filters( 'image_size_names_choose', array(
-                                        'thumbnail' =&gt; __('Thumbnail'),
-                                        'medium'    =&gt; __('Medium'),
-                                        'large'     =&gt; __('Large'),
-                                ) );
</del><ins>+                                &lt;option value=&quot;post&quot; selected&gt;
+                                        &lt;?php esc_attr_e('Attachment Page'); ?&gt;
+                                &lt;/option&gt;
+                                &lt;option value=&quot;file&quot;&gt;
+                                        &lt;?php esc_attr_e('Media File'); ?&gt;
+                                &lt;/option&gt;
+                                &lt;option value=&quot;none&quot;&gt;
+                                        &lt;?php esc_attr_e('None'); ?&gt;
+                                &lt;/option&gt;
+                        &lt;/select&gt;
+                &lt;/label&gt;
</ins><span class="cx"> 
</span><del>-                                foreach ( $sizes as $value =&gt; $name ) : ?&gt;
-                                        &lt;# if ( ! _.isUndefined( sizes['&lt;?php echo esc_js( $value ); ?&gt;'] ) ) { #&gt;
-                                                &lt;option value=&quot;&lt;?php echo esc_attr( $value ); ?&gt;&quot; &lt;?php selected( $value, 'medium' ); ?&gt;&gt;
-                                                        &lt;?php echo esc_html( $name ); ?&gt;
-                                                &lt;/option&gt;
</del><ins>+                &lt;# if ( ! _.isUndefined( sizes ) ) { #&gt;
+                        &lt;label class=&quot;setting&quot;&gt;
+                                &lt;span&gt;&lt;?php _e('Size'); ?&gt;&lt;/span&gt;
+                                &lt;select class=&quot;size&quot; name=&quot;size&quot;
+                                        data-setting=&quot;size&quot;
+                                        &lt;# if ( userSettings ) { #&gt;
+                                                data-user-setting=&quot;imgsize&quot;
</ins><span class="cx">                                         &lt;# } #&gt;&gt;
</span><del>-                                &lt;?php endforeach; ?&gt;
</del><ins>+                                        &lt;?php
</ins><span class="cx"> 
</span><del>-                                &lt;option value=&quot;full&quot;&gt;
-                                        &lt;?php echo esc_html_e( 'Full Size' ); ?&gt;
-                                &lt;/option&gt;
-                        &lt;/select&gt;
</del><ins>+                                        $sizes = apply_filters( 'image_size_names_choose', array(
+                                                'thumbnail' =&gt; __('Thumbnail'),
+                                                'medium'    =&gt; __('Medium'),
+                                                'large'     =&gt; __('Large'),
+                                        ) );
+
+                                        foreach ( $sizes as $value =&gt; $name ) : ?&gt;
+                                                &lt;# if ( ! _.isUndefined( sizes['&lt;?php echo esc_js( $value ); ?&gt;'] ) ) { #&gt;
+                                                        &lt;option value=&quot;&lt;?php echo esc_attr( $value ); ?&gt;&quot; &lt;?php selected( $value, 'medium' ); ?&gt;&gt;
+                                                                &lt;?php echo esc_html( $name ); ?&gt;
+                                                        &lt;/option&gt;
+                                                &lt;# } #&gt;&gt;
+                                        &lt;?php endforeach; ?&gt;
+
+                                        &lt;option value=&quot;full&quot;&gt;
+                                                &lt;?php echo esc_html_e( 'Full Size' ); ?&gt;
+                                        &lt;/option&gt;
+                                &lt;/select&gt;
+                        &lt;/label&gt;
</ins><span class="cx">                 &lt;# } #&gt;
</span><span class="cx">         &lt;/script&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;script type=&quot;text/html&quot; id=&quot;tmpl-gallery-settings&quot;&gt;
</span><span class="cx">                 &lt;h3&gt;&lt;?php _e('Gallery Settings'); ?&gt;&lt;/h3&gt;
</span><span class="cx"> 
</span><del>-                &lt;h4&gt;&lt;?php _e('Link To'); ?&gt;&lt;/h4&gt;
-                &lt;div class=&quot;link-to button-group&quot;
-                        data-setting=&quot;link&quot;&gt;
</del><ins>+                &lt;label class=&quot;setting&quot;&gt;
+                        &lt;span&gt;&lt;?php _e('Link To'); ?&gt;&lt;/span&gt;
+                        &lt;select class=&quot;link-to&quot;
+                                data-setting=&quot;link&quot;
+                                &lt;# if ( userSettings ) { #&gt;
+                                        data-user-setting=&quot;urlbutton&quot;
+                                &lt;# } #&gt;&gt;
</ins><span class="cx"> 
</span><del>-                        &lt;button class=&quot;button active&quot; value=&quot;post&quot;&gt;
-                                &lt;?php esc_attr_e('Attachment Page'); ?&gt;
-                        &lt;/button&gt;
-                        &lt;button class=&quot;button&quot; value=&quot;file&quot;&gt;
-                                &lt;?php esc_attr_e('Media File'); ?&gt;
-                        &lt;/button&gt;
-                &lt;/div&gt;
</del><ins>+                                &lt;option value=&quot;post&quot; selected&gt;
+                                        &lt;?php esc_attr_e('Attachment Page'); ?&gt;
+                                &lt;/option&gt;
+                                &lt;option value=&quot;file&quot;&gt;
+                                        &lt;?php esc_attr_e('Media File'); ?&gt;
+                                &lt;/option&gt;
+                        &lt;/select&gt;
+                &lt;/label&gt;
</ins><span class="cx"> 
</span><del>-                &lt;h4&gt;&lt;?php _e('Gallery Columns'); ?&gt;&lt;/h4&gt;
-
-                &lt;select class=&quot;columns&quot; name=&quot;columns&quot;
-                        data-setting=&quot;columns&quot;&gt;
-                        &lt;?php for ( $i = 1; $i &lt;= 9; $i++ ) : ?&gt;
-                                &lt;option value=&quot;&lt;?php echo esc_attr( $i ); ?&gt;&quot; &lt;?php selected( $i, 3 ); ?&gt;&gt;
-                                        &lt;?php echo esc_html( $i ); ?&gt;
-                                &lt;/option&gt;
-                        &lt;?php endfor; ?&gt;
-                &lt;/select&gt;
</del><ins>+                &lt;label class=&quot;setting&quot;&gt;
+                        &lt;span&gt;&lt;?php _e('Columns'); ?&gt;&lt;/span&gt;
+                        &lt;select class=&quot;columns&quot; name=&quot;columns&quot;
+                                data-setting=&quot;columns&quot;&gt;
+                                &lt;?php for ( $i = 1; $i &lt;= 9; $i++ ) : ?&gt;
+                                        &lt;option value=&quot;&lt;?php echo esc_attr( $i ); ?&gt;&quot; &lt;?php selected( $i, 3 ); ?&gt;&gt;
+                                                &lt;?php echo esc_html( $i ); ?&gt;
+                                        &lt;/option&gt;
+                                &lt;?php endfor; ?&gt;
+                        &lt;/select&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-editor-attachment&quot;&gt;
</span></span></pre>
</div>
</div>

</body>
</html>