<!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>[23753] trunk: Remove separate meta fields for image and gallery post formats.</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/23753">23753</a></dd>
<dt>Author</dt> <dd>helen</dd>
<dt>Date</dt> <dd>2013-03-19 17:18:07 +0000 (Tue, 19 Mar 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove separate meta fields for image and gallery post formats. These are proving to be more confusing and labor-intensive from both a user and dev perspective than entering into the regular content editor. We will rely on good content parsing instead. See <a href="http://core.trac.wordpress.org/ticket/19570">#19570</a>, <a href="http://core.trac.wordpress.org/ticket/23347">#23347</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="#trunkwpadminjspostformatsjs">trunk/wp-admin/js/post-formats.js</a></li>
<li><a href="#trunkwpincludespostformatsphp">trunk/wp-includes/post-formats.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 (23752 => 23753)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/wp-admin.css        2013-03-19 05:05:19 UTC (rev 23752)
+++ trunk/wp-admin/css/wp-admin.css        2013-03-19 17:18:07 UTC (rev 23753)
</span><span class="lines">@@ -3097,63 +3097,33 @@
</span><span class="cx">         padding-bottom: 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.wp-format-standard .post-formats-fields,
-.wp-format-aside .post-formats-fields,
-.wp-format-chat .post-formats-fields,
-.wp-format-status .post-formats-fields {
</del><ins>+.post-formats-fields {
</ins><span class="cx">         display: none;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.post-formats-fields .field {
-        display: none;
-        margin-bottom: 10px;
-}
-
-.post-formats-fields input,
-.post-formats-fields textarea {
-        padding: 5px;
-        font-size: 1.2em;
-}
-
</del><ins>+.wp-format-link .post-formats-fields,
+.wp-format-quote .post-formats-fields,
+.wp-format-video .post-formats-fields,
+.wp-format-audio .post-formats-fields,
</ins><span class="cx"> .wp-format-chat .field.wp-format-chat,
</span><del>-.wp-format-gallery .field.wp-format-gallery,
</del><span class="cx"> .wp-format-link .field.wp-format-link,
</span><del>-.wp-format-image .field.wp-format-image,
</del><span class="cx"> .wp-format-quote .field.wp-format-quote,
</span><span class="cx"> .wp-format-video .field.wp-format-video,
</span><span class="cx"> .wp-format-audio .field.wp-format-audio {
</span><span class="cx">         display: block;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#wp-format-image-holder {
-        overflow: hidden;
-        width: 300px;
-        height: 200px;
-        border: 1px solid #dfdfdf;
-        background: #f5f5f5;
</del><ins>+.post-formats-fields .field {
+        display: none;
+        margin-bottom: 10px;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-#wp-format-image-holder:hover {
-        background-color: #eee;
</del><ins>+.post-formats-fields input,
+.post-formats-fields textarea {
+        padding: 5px;
+        font-size: 1.2em;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-#wp-format-image-select {
-        display: block;
-        height: 200px;
-        text-align: center;
-}
-
-#wp-format-image-select img {
-        max-width: 100%;
-        max-height: 100%;
-}
-
-.empty #wp-format-image-select {
-        padding-top: 120px;
-        height: 80px;
-        background: url(../images/media-button-2x.png) no-repeat center;
-}
-
</del><span class="cx"> /* Post Screen */
</span><span class="cx"> #post-body #normal-sortables {
</span><span class="cx">         min-height: 50px;
</span></span></pre></div>
<a id="trunkwpadmineditformadvancedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-form-advanced.php (23752 => 23753)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-form-advanced.php        2013-03-19 05:05:19 UTC (rev 23752)
+++ trunk/wp-admin/edit-form-advanced.php        2013-03-19 17:18:07 UTC (rev 23753)
</span><span class="lines">@@ -393,11 +393,6 @@
</span><span class="cx"> // post format fields
</span><span class="cx"> if ( post_type_supports( $post_type, 'post-formats' ) ) {
</span><span class="cx">         $format_meta = get_post_format_meta( $post_ID );
</span><del>-
-if ( isset( $format_meta['image'] ) )
-        $image = is_numeric( $format_meta['image'] ) ? wp_get_attachment_url( $format_meta['image'] ) : $format_meta['image'];
-else
-        $image = false;
</del><span class="cx"> ?&gt;
</span><span class="cx"> &lt;div class=&quot;post-formats-fields edit-form-section&quot;&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -413,33 +408,11 @@
</span><span class="cx">         &lt;input type=&quot;text&quot; name=&quot;_wp_format_quote_source&quot; value=&quot;&lt;?php echo esc_attr( $format_meta['quote_source'] ); ?&gt;&quot; placeholder=&quot;&lt;?php esc_attr_e( 'Quote source' ); ?&gt;&quot; class=&quot;widefat&quot; /&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div class=&quot;field wp-format-image&quot;&gt;
-        &lt;div id=&quot;wp-format-image-holder&quot; class=&quot;hide-if-no-js&lt;?php if ( ! $image ) echo ' empty'; ?&gt;&quot;&gt;
-                &lt;a href=&quot;#&quot; id=&quot;wp-format-image-select&quot;
-                        data-choose=&quot;&lt;?php esc_attr_e( 'Choose an Image' ); ?&gt;&quot;
-                        data-update=&quot;&lt;?php esc_attr_e( 'Select Image' ); ?&gt;&quot;&gt;
-                        &lt;?php
-                                if ( $image )
-                                        echo '&lt;img src=&quot;' . esc_url( $image ) . '&quot; /&gt;';
-                                else
-                                        _e( 'Select Image' );
-                        ?&gt;
-                &lt;/a&gt;
-        &lt;/div&gt;
-        &lt;label for=&quot;_wp_format_image&quot; class=&quot;screen-reader-text&quot;&gt;&lt;?php _e( 'Image ID or URL' ); ?&gt;:&lt;/label&gt;
-        &lt;input type=&quot;text&quot; name=&quot;_wp_format_image&quot; id=&quot;wp_format_image&quot; value=&quot;&lt;?php echo esc_attr( $format_meta['image'] ); ?&gt;&quot; placeholder=&quot;&lt;?php esc_attr_e( 'Image ID or URL' ); ?&gt;&quot; class=&quot;widefat hide-if-js&quot; /&gt;
-&lt;/div&gt;
-
-&lt;div class=&quot;field wp-format-link wp-format-quote wp-format-image&quot;&gt;
</del><ins>+&lt;div class=&quot;field wp-format-link wp-format-quote&quot;&gt;
</ins><span class="cx">         &lt;label for=&quot;_wp_format_url&quot; class=&quot;screen-reader-text&quot;&gt;&lt;?php _e( 'Link URL' ); ?&gt;:&lt;/label&gt;
</span><span class="cx">         &lt;input type=&quot;text&quot; name=&quot;_wp_format_url&quot; value=&quot;&lt;?php echo esc_url( $format_meta['url'] ); ?&gt;&quot; placeholder=&quot;&lt;?php esc_attr_e( 'Link URL' ); ?&gt;&quot; class=&quot;widefat&quot; /&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div class=&quot;field wp-format-gallery&quot;&gt;
-        &lt;label for=&quot;_wp_format_gallery&quot; class=&quot;screen-reader-text&quot;&gt;&lt;?php _e( 'Gallery shortcode' ); ?&gt;:&lt;/label&gt;
-        &lt;input type=&quot;text&quot; name=&quot;_wp_format_gallery&quot; id=&quot;wp_format_gallery&quot; value=&quot;&lt;?php echo esc_attr( $format_meta['gallery'] ); ?&gt;&quot; placeholder=&quot;&lt;?php esc_attr_e( 'Gallery shortcode' ); ?&gt;&quot; class=&quot;widefat&quot; /&gt;
-&lt;/div&gt;
-
</del><span class="cx"> &lt;div class=&quot;field wp-format-audio wp-format-video&quot;&gt;
</span><span class="cx">         &lt;label for=&quot;_wp_format_media&quot; class=&quot;screen-reader-text&quot;&gt;&lt;?php _e( 'Embed code or URL' ); ?&gt;:&lt;/label&gt;
</span><span class="cx">         &lt;textarea name=&quot;_wp_format_media&quot; placeholder=&quot;&lt;?php esc_attr_e( 'Embed code or URL' ); ?&gt;&quot; class=&quot;widefat&quot;&gt;&lt;?php echo esc_textarea( $format_meta['media'] ); ?&gt;&lt;/textarea&gt;
</span></span></pre></div>
<a id="trunkwpadminjspostformatsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/post-formats.js (23752 => 23753)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/post-formats.js        2013-03-19 05:05:19 UTC (rev 23752)
+++ trunk/wp-admin/js/post-formats.js        2013-03-19 17:18:07 UTC (rev 23753)
</span><span class="lines">@@ -1,12 +1,12 @@
</span><del>-window.wp = window.wp || {};
-
</del><span class="cx"> (function($){
</span><del>-        var imageFrame;
</del><span class="cx"> 
</span><span class="cx">         // Post formats selection
</span><span class="cx">         $('.post-format-select a').on( 'click.post-format', function(e) {
</span><del>-                var $this = $(this), editor, body,
-                        format = $this.data('wp-format'), container = $('#post-body-content');
</del><ins>+                var $this = $(this),
+                        editor,
+                        body,
+                        format = $this.data('wp-format'),
+                        container = $('#post-body-content');
</ins><span class="cx"> 
</span><span class="cx">                 $('.post-format-select a.nav-tab-active').removeClass('nav-tab-active');
</span><span class="cx">                 $this.addClass('nav-tab-active').blur();
</span><span class="lines">@@ -28,50 +28,4 @@
</span><span class="cx">                 e.preventDefault();
</span><span class="cx">         });
</span><span class="cx"> 
</span><del>-        // Image selection
-        $('#wp-format-image-select').click( function( event ) {
-                var $el = $(this),
-                        $holder = $('#wp-format-image-holder'),
-                        $field = $('#wp_format_image');
-                event.preventDefault();
-
-                // If the media frame already exists, reopen it.
-                if ( imageFrame ) {
-                        imageFrame.open();
-                        return;
-                }
-
-                // Create the media frame.
-                imageFrame = wp.media.frames.formatImage = wp.media({
-                        // Set the title of the modal.
-                        title: $el.data('choose'),
-
-                        // Tell the modal to show only images.
-                        library: {
-                                type: 'image'
-                        },
-
-                        // Customize the submit button.
-                        button: {
-                                // Set the text of the button.
-                                text: $el.data('update')
-                        }
-                });
-
-                // When an image is selected, run a callback.
-                imageFrame.on( 'select', function() {
-                        // Grab the selected attachment.
-                        var attachment = imageFrame.state().get('selection').first(),
-                                imageUrl = attachment.get('url');
-
-                        // set the hidden input's value
-                        $field.attr('value', attachment.id);
-
-                        // Show the image in the placeholder
-                        $el.html('&lt;img src=&quot;' + imageUrl + '&quot; /&gt;');
-                        $holder.removeClass('empty');
-                });
-
-                imageFrame.open();
-        });
</del><span class="cx"> })(jQuery);
</span></span></pre></div>
<a id="trunkwpincludespostformatsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/post-formats.php (23752 => 23753)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/post-formats.php        2013-03-19 05:05:19 UTC (rev 23752)
+++ trunk/wp-includes/post-formats.php        2013-03-19 17:18:07 UTC (rev 23753)
</span><span class="lines">@@ -83,9 +83,7 @@
</span><span class="cx">         $values = array(
</span><span class="cx">                 'quote'        =&gt; '',
</span><span class="cx">                 'quote_source' =&gt; '',
</span><del>-                'image'        =&gt; '',
</del><span class="cx">                 'url'          =&gt; '',
</span><del>-                'gallery'      =&gt; '',
</del><span class="cx">                 'media'        =&gt; '',
</span><span class="cx">         );
</span><span class="cx"> 
</span><span class="lines">@@ -299,7 +297,6 @@
</span><span class="cx">                 'tag' =&gt; 'div',
</span><span class="cx">                 'class' =&gt; get_post_format_content_class( $format ),
</span><span class="cx">                 'link_class' =&gt; '',
</span><del>-                'image_class' =&gt; '',
</del><span class="cx">         );
</span><span class="cx"> 
</span><span class="cx">         $args = apply_filters( 'post_format_compat', array() );
</span><span class="lines">@@ -343,34 +340,6 @@
</span><span class="cx">                         }
</span><span class="cx">                         break;
</span><span class="cx"> 
</span><del>-                case 'image':
-                        if ( ! empty( $meta['image'] ) ) {
-                                $image = is_numeric( $meta['image'] ) ? wp_get_attachment_url( $meta['image'] ) : $meta['image'];
-
-                                if ( ! empty( $image ) &amp;&amp; ! stristr( $content, $image ) ) {
-                                        $image_html = sprintf(
-                                                '&lt;img %ssrc=&quot;%s&quot; alt=&quot;&quot; /&gt;',
-                                                empty( $compat['image_class'] ) ? '' : sprintf( 'class=&quot;%s&quot; ', esc_attr( $compat['image_class'] ) ),
-                                                $image
-                                        );
-                                        if ( empty( $meta['url'] ) ) {
-                                                $format_output .= $image_html;
-                                        } else {
-                                                $format_output .= sprintf(
-                                                        '&lt;a href=&quot;%s&quot;&gt;%s&lt;/a&gt;',
-                                                        esc_url( $meta['url'] ),
-                                                        $image_html
-                                                );
-                                        }
-                                }
-                        }
-                        break;
-
-                case 'gallery':
-                        if ( ! has_shortcode( $post-&gt;post_content, $format ) &amp;&amp; ! empty( $meta['gallery'] ) )
-                                $format_output .= $meta['gallery'];
-                        break;
-
</del><span class="cx">                 case 'video':
</span><span class="cx">                 case 'audio':
</span><span class="cx">                         if ( ! has_shortcode( $post-&gt;post_content, $format ) &amp;&amp; ! empty( $meta['media'] ) ) {
</span></span></pre>
</div>
</div>

</body>
</html>