<!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>[24021] trunk: Standardize post format postmeta keys around the ones already used by the Crowd Favorite plugin.</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/24021">24021</a></dd>
<dt>Author</dt> <dd>markjaquith</dd>
<dt>Date</dt> <dd>2013-04-17 20:57:44 +0000 (Wed, 17 Apr 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Standardize post format postmeta keys around the ones already used by the Crowd Favorite plugin.

props wonderboymusic. fixes <a href="http://core.trac.wordpress.org/ticket/24010">#24010</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludespostformatsphp">trunk/wp-admin/includes/post-formats.php</a></li>
<li><a href="#trunkwpadminincludespostphp">trunk/wp-admin/includes/post.php</a></li>
<li><a href="#trunkwpadminjspostformatsjs">trunk/wp-admin/js/post-formats.js</a></li>
<li><a href="#trunkwpincludesjsautosavejs">trunk/wp-includes/js/autosave.js</a></li>
<li><a href="#trunkwpincludesmediaphp">trunk/wp-includes/media.php</a></li>
<li><a href="#trunkwpincludespostformatsphp">trunk/wp-includes/post-formats.php</a></li>
<li><a href="#trunkwpincludesrevisionphp">trunk/wp-includes/revision.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludespostformatsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/post-formats.php (24020 => 24021)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/post-formats.php        2013-04-17 20:12:25 UTC (rev 24020)
+++ trunk/wp-admin/includes/post-formats.php        2013-04-17 20:57:44 UTC (rev 24021)
</span><span class="lines">@@ -11,28 +11,30 @@
</span><span class="cx"> 
</span><span class="cx">         &lt;div class=&quot;field wp-format-quote&quot;&gt;
</span><span class="cx">                 &lt;label for=&quot;wp_format_quote&quot;&gt;&lt;?php _e( 'Quote' ); ?&gt;&lt;/label&gt;
</span><del>-                &lt;textarea id=&quot;wp_format_quote&quot; name=&quot;_wp_format_quote&quot; class=&quot;widefat&quot;&gt;&lt;?php echo esc_textarea( $format_meta['quote'] ); ?&gt;&lt;/textarea&gt;
</del><ins>+                &lt;textarea id=&quot;wp_format_quote&quot; name=&quot;_format_quote&quot; class=&quot;widefat&quot;&gt;&lt;?php echo esc_textarea( $format_meta['quote'] ); ?&gt;&lt;/textarea&gt;
</ins><span class="cx">         &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;div class=&quot;field wp-format-quote&quot;&gt;
</span><span class="cx">                 &lt;label for=&quot;wp_format_quote_source&quot;&gt;&lt;?php _e( 'Quote source' ); ?&gt;&lt;/label&gt;
</span><del>-                &lt;input type=&quot;text&quot; id=&quot;wp_format_quote_source&quot; name=&quot;_wp_format_quote_source&quot; value=&quot;&lt;?php echo esc_attr( $format_meta['quote_source'] ); ?&gt;&quot; class=&quot;widefat&quot; /&gt;
</del><ins>+                &lt;input type=&quot;text&quot; id=&quot;wp_format_quote_source&quot; name=&quot;_format_quote_source_name&quot; value=&quot;&lt;?php echo esc_attr( $format_meta['quote_source_name'] ); ?&gt;&quot; class=&quot;widefat&quot; /&gt;
</ins><span class="cx">         &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;div class=&quot;field wp-format-image&quot;&gt;
</span><del>-                &lt;?php if ( ! empty( $format_meta['image'] ) ) : ?&gt;
</del><ins>+                &lt;?php if ( ! empty( $format_meta['image'] ) ) :
+                        $value = $format_meta['image'];
+                ?&gt;
</ins><span class="cx">                 &lt;div id=&quot;image-preview&quot; class=&quot;wp-format-media-preview&quot;&gt;
</span><span class="cx">                         &lt;?php
</span><del>-                                if ( is_numeric( $format_meta['image'] ) ) {
-                                        $format_meta['image'] = absint( $format_meta['image'] );
</del><ins>+                                if ( is_numeric( $value ) ) {
+                                        $format_meta['image'] = absint( $value );
</ins><span class="cx">                                         $image = wp_get_attachment_url( $format_meta['image'] );
</span><span class="cx">                                         printf( '&lt;img src=&quot;%s&quot; alt=&quot;%s&quot; /&gt;', esc_url( $image ), get_the_title( $format_meta['image'] ) );
</span><del>-                                } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $format_meta['image'] ) ) {
-                                        echo do_shortcode( $format_meta['image'] );
-                                } elseif ( ! preg_match( '#&lt;[^&gt;]+&gt;#', $format_meta['image'] ) ) {
-                                        printf( '&lt;img src=&quot;%s&quot; alt=&quot;&quot; /&gt;', esc_url( $format_meta['image'] ) );
</del><ins>+                                } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $value ) ) {
+                                        echo do_shortcode( $value );
+                                } elseif ( ! preg_match( '#&lt;[^&gt;]+&gt;#', $value ) ) {
+                                        printf( '&lt;img src=&quot;%s&quot; alt=&quot;&quot; /&gt;', esc_url( $value ) );
</ins><span class="cx">                                 } else {
</span><del>-                                        echo $format_meta['image'];
</del><ins>+                                        echo $value;
</ins><span class="cx">                                 }
</span><span class="cx">                         ?&gt;
</span><span class="cx">                 &lt;/div&gt;
</span><span class="lines">@@ -43,7 +45,7 @@
</span><span class="cx">                         else
</span><span class="cx">                                 _e( 'Image URL' );
</span><span class="cx">                 ?&gt;&lt;/label&gt;
</span><del>-                &lt;textarea id=&quot;wp_format_image&quot; type=&quot;text&quot; name=&quot;_wp_format_image&quot; class=&quot;widefat&quot;&gt;&lt;?php esc_html_e( $format_meta['image'] ); ?&gt;&lt;/textarea&gt;
</del><ins>+                &lt;textarea id=&quot;wp_format_image&quot; type=&quot;text&quot; name=&quot;_format_image&quot; class=&quot;widefat&quot;&gt;&lt;?php esc_html_e( $format_meta['image'] ); ?&gt;&lt;/textarea&gt;
</ins><span class="cx">                 &lt;div data-format=&quot;image&quot; class=&quot;wp-format-media-holder hide-if-no-js&quot;&gt;
</span><span class="cx">                         &lt;a href=&quot;#&quot; class=&quot;wp-format-media-select&quot;
</span><span class="cx">                                 data-choose=&quot;&lt;?php esc_attr_e( 'Choose an Image' ); ?&gt;&quot;
</span><span class="lines">@@ -53,27 +55,39 @@
</span><span class="cx">                 &lt;/div&gt;
</span><span class="cx">         &lt;/div&gt;
</span><span class="cx"> 
</span><del>-        &lt;div class=&quot;field wp-format-link wp-format-quote wp-format-image&quot;&gt;
-                &lt;label for=&quot;wp_format_url&quot;&gt;&lt;?php _e( 'Link URL' ); ?&gt;&lt;/label&gt;
-                &lt;input type=&quot;text&quot; id=&quot;wp_format_url&quot; name=&quot;_wp_format_url&quot; value=&quot;&lt;?php echo esc_url( $format_meta['url'] ); ?&gt;&quot; class=&quot;widefat&quot; /&gt;
</del><ins>+        &lt;div class=&quot;field wp-format-link&quot;&gt;
+                &lt;label for=&quot;wp_format_link_url&quot;&gt;&lt;?php _e( 'Link URL' ); ?&gt;&lt;/label&gt;
+                &lt;input type=&quot;text&quot; id=&quot;wp_format_link_url&quot; name=&quot;_format_link_url&quot; value=&quot;&lt;?php echo esc_url( $format_meta['link_url'] ); ?&gt;&quot; class=&quot;widefat&quot; /&gt;
</ins><span class="cx">         &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+        &lt;div class=&quot;field wp-format-quote&quot;&gt;
+                &lt;label for=&quot;wp_format_quote_source_url&quot;&gt;&lt;?php _e( 'Link URL' ); ?&gt;&lt;/label&gt;
+                &lt;input type=&quot;text&quot; id=&quot;wp_format_quote_source_url&quot; name=&quot;_format_quote_source_url&quot; value=&quot;&lt;?php echo esc_url( $format_meta['quote_source_url'] ); ?&gt;&quot; class=&quot;widefat&quot; /&gt;
+        &lt;/div&gt;
+
+        &lt;div class=&quot;field wp-format-image&quot;&gt;
+                &lt;label for=&quot;wp_format_image_url&quot;&gt;&lt;?php _e( 'Link URL' ); ?&gt;&lt;/label&gt;
+                &lt;input type=&quot;text&quot; id=&quot;wp_format_image_url&quot; name=&quot;_format_url&quot; value=&quot;&lt;?php echo esc_url( $format_meta['url'] ); ?&gt;&quot; class=&quot;widefat&quot; /&gt;
+        &lt;/div&gt;
+
</ins><span class="cx">         &lt;div class=&quot;field wp-format-video&quot;&gt;
</span><del>-                &lt;?php if ( ! empty( $format_meta['video'] ) ): ?&gt;
</del><ins>+                &lt;?php if ( ! empty( $format_meta['video_embed'] ) ):
+                        $value = $format_meta['video_embed'];
+                ?&gt;
</ins><span class="cx">                 &lt;div id=&quot;video-preview&quot; class=&quot;wp-format-media-preview&quot;&gt;
</span><span class="cx">                         &lt;?php
</span><del>-                                if ( is_numeric( $format_meta['video'] ) ) {
-                                        $url = wp_get_attachment_url( $format_meta['video'] );
</del><ins>+                                if ( is_numeric( $value ) ) {
+                                        $url = wp_get_attachment_url( $value );
</ins><span class="cx">                                         echo do_shortcode( sprintf( '[video src=&quot;%s&quot;]', $url ) );
</span><del>-                                } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $format_meta['video'] ) ) {
-                                        echo do_shortcode( $format_meta['video'] );
-                                } elseif ( ! preg_match( '#&lt;[^&gt;]+&gt;#', $format_meta['video'] ) ) {
-                                        if ( strstr( $format_meta['video'], home_url() ) )
-                                                echo do_shortcode( sprintf( '[video src=&quot;%s&quot;]', $format_meta['video'] ) );
</del><ins>+                                } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $value ) ) {
+                                        echo do_shortcode( $value );
+                                } elseif ( ! preg_match( '#&lt;[^&gt;]+&gt;#', $value ) ) {
+                                        if ( strstr( $value, home_url() ) )
+                                                echo do_shortcode( sprintf( '[video src=&quot;%s&quot;]', $value ) );
</ins><span class="cx">                                         else
</span><del>-                                                echo $wp_embed-&gt;autoembed( $format_meta['video'] );
</del><ins>+                                                echo $wp_embed-&gt;autoembed( $value );
</ins><span class="cx">                                 } else {
</span><del>-                                        echo $format_meta['video'];
</del><ins>+                                        echo $value;
</ins><span class="cx">                                 }
</span><span class="cx">                         ?&gt;
</span><span class="cx">                 &lt;/div&gt;
</span><span class="lines">@@ -84,7 +98,7 @@
</span><span class="cx">                         else
</span><span class="cx">                                 _e( 'Video URL' );
</span><span class="cx">                 ?&gt;&lt;/label&gt;
</span><del>-                &lt;textarea id=&quot;wp_format_video&quot; type=&quot;text&quot; name=&quot;_wp_format_video&quot; class=&quot;widefat&quot;&gt;&lt;?php esc_html_e( $format_meta['video'] ); ?&gt;&lt;/textarea&gt;
</del><ins>+                &lt;textarea id=&quot;wp_format_video&quot; type=&quot;text&quot; name=&quot;_format_video_embed&quot; class=&quot;widefat&quot;&gt;&lt;?php esc_html_e( $format_meta['video_embed'] ); ?&gt;&lt;/textarea&gt;
</ins><span class="cx">                 &lt;div data-format=&quot;video&quot; class=&quot;wp-format-media-holder hide-if-no-js&quot;&gt;
</span><span class="cx">                         &lt;a href=&quot;#&quot; class=&quot;wp-format-media-select&quot;
</span><span class="cx">                                 data-choose=&quot;&lt;?php esc_attr_e( 'Choose a Video' ); ?&gt;&quot;
</span><span class="lines">@@ -95,21 +109,23 @@
</span><span class="cx">         &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;div class=&quot;field wp-format-audio&quot;&gt;
</span><del>-                &lt;?php if ( ! empty( $format_meta['audio'] ) ): ?&gt;
</del><ins>+                &lt;?php if ( ! empty( $format_meta['audio_embed'] ) ):
+                        $value = $format_meta['audio_embed'];
+                ?&gt;
</ins><span class="cx">                 &lt;div id=&quot;audio-preview&quot; class=&quot;wp-format-media-preview&quot;&gt;
</span><span class="cx">                         &lt;?php
</span><del>-                                if ( is_numeric( $format_meta['audio'] ) ) {
-                                        $url = wp_get_attachment_url( $format_meta['audio'] );
</del><ins>+                                if ( is_numeric( $value ) ) {
+                                        $url = wp_get_attachment_url( $value );
</ins><span class="cx">                                         echo do_shortcode( sprintf( '[audio src=&quot;%s&quot;]', $url ) );
</span><del>-                                } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $format_meta['audio'] ) ) {
-                                        echo do_shortcode( $format_meta['audio'] );
-                                } elseif ( ! preg_match( '#&lt;[^&gt;]+&gt;#', $format_meta['audio'] ) ) {
-                                        if ( strstr( $format_meta['audio'], home_url() ) )
-                                                echo do_shortcode( sprintf( '[audio src=&quot;%s&quot;]', $format_meta['audio'] ) );
</del><ins>+                                } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $value ) ) {
+                                        echo do_shortcode( $value );
+                                } elseif ( ! preg_match( '#&lt;[^&gt;]+&gt;#', $value ) ) {
+                                        if ( strstr( $value, home_url() ) )
+                                                echo do_shortcode( sprintf( '[audio src=&quot;%s&quot;]', $value ) );
</ins><span class="cx">                                         else
</span><del>-                                                echo $wp_embed-&gt;autoembed( $format_meta['audio'] );
</del><ins>+                                                echo $wp_embed-&gt;autoembed( $value );
</ins><span class="cx">                                 } else {
</span><del>-                                        echo $format_meta['audio'];
</del><ins>+                                        echo $value;
</ins><span class="cx">                                 }
</span><span class="cx">                         ?&gt;
</span><span class="cx">                 &lt;/div&gt;
</span><span class="lines">@@ -120,7 +136,7 @@
</span><span class="cx">                         else
</span><span class="cx">                                 _e( 'Audio URL' );
</span><span class="cx">                 ?&gt;&lt;/label&gt;
</span><del>-                &lt;textarea id=&quot;wp_format_audio&quot; name=&quot;_wp_format_audio&quot; class=&quot;widefat&quot;&gt;&lt;?php esc_html_e( $format_meta['audio'] ); ?&gt;&lt;/textarea&gt;
</del><ins>+                &lt;textarea id=&quot;wp_format_audio&quot; name=&quot;_format_audio_embed&quot; class=&quot;widefat&quot;&gt;&lt;?php esc_html_e( $format_meta['audio_embed'] ); ?&gt;&lt;/textarea&gt;
</ins><span class="cx">                 &lt;div data-format=&quot;audio&quot; class=&quot;wp-format-media-holder hide-if-no-js&quot;&gt;
</span><span class="cx">                         &lt;a href=&quot;#&quot; class=&quot;wp-format-media-select&quot; data-choose=&quot;&lt;?php esc_attr_e( 'Choose Audio' ); ?&gt;&quot; data-update=&quot;&lt;?php esc_attr_e( 'Select Audio' ); ?&gt;&quot;&gt;
</span><span class="cx">                                 &lt;?php _e( 'Select Audio From Media Library' ) ?&gt;
</span></span></pre></div>
<a id="trunkwpadminincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/post.php (24020 => 24021)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/post.php        2013-04-17 20:12:25 UTC (rev 24020)
+++ trunk/wp-admin/includes/post.php        2013-04-17 20:57:44 UTC (rev 24021)
</span><span class="lines">@@ -192,22 +192,25 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // Post Formats
</span><del>-        if ( isset( $post_data['post_format'] ) ) {
</del><ins>+        if ( isset( $post_data['post_format'] ) )
</ins><span class="cx">                 set_post_format( $post_ID, $post_data['post_format'] );
</span><del>-        }
</del><span class="cx"> 
</span><del>-        if ( isset( $post_data[ '_wp_format_url' ] ) ) {
-                update_post_meta( $post_ID, '_wp_format_url', wp_slash( esc_url_raw( wp_unslash( $post_data['_wp_format_url'] ) ) ) );
</del><ins>+        $format_meta_urls = array( 'url', 'link_url', 'quote_source_url' );
+        foreach ( $format_meta_urls as $format_meta_url ) {
+                $keyed = '_format_' . $format_meta_url;
+                if ( isset( $post_data[ $keyed ] ) )
+                        update_post_meta( $post_ID, $keyed, wp_slash( esc_url_raw( wp_unslash( $post_data[ $keyed ] ) ) ) );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        $format_keys = array( 'quote', 'quote_source', 'image', 'gallery', 'audio', 'video' );
</del><ins>+        $format_keys = array( 'quote', 'quote_source_name', 'image', 'gallery', 'audio_embed', 'video_embed' );
</ins><span class="cx"> 
</span><span class="cx">         foreach ( $format_keys as $key ) {
</span><del>-                if ( isset( $post_data[ '_wp_format_' . $key ] ) ) {
</del><ins>+                $keyed = '_format_' . $key;
+                if ( isset( $post_data[ $keyed ] ) ) {
</ins><span class="cx">                         if ( current_user_can( 'unfiltered_html' ) )
</span><del>-                                update_post_meta( $post_ID, '_wp_format_' . $key, $post_data[ '_wp_format_' . $key ] );
</del><ins>+                                update_post_meta( $post_ID, $keyed, $post_data[ $keyed ] );
</ins><span class="cx">                         else
</span><del>-                                update_post_meta( $post_ID, '_wp_format_' . $key, wp_filter_post_kses( $post_data[ '_wp_format_' . $key ] ) );
</del><ins>+                                update_post_meta( $post_ID, $keyed, wp_filter_post_kses( $post_data[ $keyed ] ) );
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminjspostformatsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/post-formats.js (24020 => 24021)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/post-formats.js        2013-04-17 20:12:25 UTC (rev 24020)
+++ trunk/wp-admin/js/post-formats.js        2013-04-17 20:57:44 UTC (rev 24021)
</span><span class="lines">@@ -1,9 +1,9 @@
</span><span class="cx"> window.wp = window.wp || {};
</span><span class="cx"> 
</span><span class="cx"> (function($) {
</span><del>-        var container, mediaFrame, lastMimeType, lastMenu, mediaPreview,
-            noUIFormats = ['standard', 'chat', 'status', 'aside', 'gallery'],
-            $container  = $( '.post-formats-fields' );
</del><ins>+        var container, mediaFrame, lastMimeType, mediaPreview,
+                noUIFormats = ['standard', 'chat', 'status', 'aside', 'gallery'],
+                $container = $( '.post-formats-fields' );
</ins><span class="cx"> 
</span><span class="cx">         function switchFormatClass( format ) {
</span><span class="cx">                 container.get(0).className = container.get(0).className.replace( /\bwp-format-[^ ]+/g, '' );
</span><span class="lines">@@ -76,9 +76,9 @@
</span><span class="cx">                 // Media selection
</span><span class="cx">                 $('.wp-format-media-select').click(function(event) {
</span><span class="cx">                         event.preventDefault();
</span><del>-                        var $el = $(this), mime,
-                            $holder = $el.closest('.wp-format-media-holder'),
-                            $field = $( '#wp_format_' + $holder.data('format') );
</del><ins>+                        var $el = $(this), mime = 'image',
+                                $holder = $el.closest('.wp-format-media-holder'),
+                                $field = $( '#wp_format_' + $holder.data('format') );
</ins><span class="cx"> 
</span><span class="cx">                         mime = $holder.data('format');
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludesjsautosavejs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/autosave.js (24020 => 24021)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/autosave.js        2013-04-17 20:12:25 UTC (rev 24020)
+++ trunk/wp-includes/js/autosave.js        2013-04-17 20:57:44 UTC (rev 24021)
</span><span class="lines">@@ -367,7 +367,7 @@
</span><span class="cx">         post_format = $('#post_format').val() || '';
</span><span class="cx">         data['post_format'] = post_format == 'standard' ? '' : post_format;
</span><span class="cx"> 
</span><del>-        $('.post-formats-fields').find('input[name^=&quot;_wp_format_&quot;], textarea[name^=&quot;_wp_format_&quot;]').each( function(i, field) {
</del><ins>+        $('.post-formats-fields').find('input[name^=&quot;_format_&quot;], textarea[name^=&quot;_format_&quot;]').each( function(i, field) {
</ins><span class="cx">                 data[ field.name ] = field.value || '';
</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 (24020 => 24021)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/media.php        2013-04-17 20:12:25 UTC (rev 24020)
+++ trunk/wp-includes/media.php        2013-04-17 20:57:44 UTC (rev 24021)
</span><span class="lines">@@ -2074,21 +2074,22 @@
</span><span class="cx"> 
</span><span class="cx">         if ( has_post_format( $type, $post ) ) {
</span><span class="cx">                 $meta = get_post_format_meta( $post-&gt;ID );
</span><del>-                if ( ! empty( $meta[$type] ) ) {
-                        if ( is_integer( $meta[$type] ) ) {
-                                $url = wp_get_attachment_url( $meta[$type] );
</del><ins>+                if ( ! empty( $meta[$type . '_embed'] ) ) {
+                        $value = $meta[$type . '_embed'];
+                        if ( is_integer( $value ) ) {
+                                $url = wp_get_attachment_url( $value );
</ins><span class="cx">                                 $shortcode = sprintf( '[%s src=&quot;%s&quot;]', $type, $url );
</span><del>-                        } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $meta[$type] ) ) {
-                                $shortcode = $meta[$type];
-                        } elseif ( preg_match( '#&lt;[^&gt;]+&gt;#', $meta[$type] ) ) {
-                                $post-&gt;format_content = $meta[$type];
</del><ins>+                        } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $value ) ) {
+                                $shortcode = $value;
+                        } elseif ( preg_match( '#&lt;[^&gt;]+&gt;#', $value ) ) {
+                                $post-&gt;format_content = $value;
</ins><span class="cx">                                 return $post-&gt;format_content;
</span><del>-                        } elseif ( 0 === strpos( $meta[$type], 'http' ) ) {
-                                $post-&gt;split_content = str_replace( $meta[$type], '', $post-&gt;post_content, $count );
-                                if ( strstr( $meta[$type], home_url() ) ) {
-                                        $shortcode = sprintf( '[%s src=&quot;%s&quot;]', $type, $meta[$type] );
</del><ins>+                        } elseif ( 0 === strpos( $value, 'http' ) ) {
+                                $post-&gt;split_content = str_replace( $value, '', $post-&gt;post_content, $count );
+                                if ( strstr( $value, home_url() ) ) {
+                                        $shortcode = sprintf( '[%s src=&quot;%s&quot;]', $type, $value );
</ins><span class="cx">                                 } else {
</span><del>-                                        $post-&gt;format_content = $wp_embed-&gt;autoembed( $meta[$type] );
</del><ins>+                                        $post-&gt;format_content = $wp_embed-&gt;autoembed( $value );
</ins><span class="cx">                                         return $post-&gt;format_content;
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span></span></pre></div>
<a id="trunkwpincludespostformatsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/post-formats.php (24020 => 24021)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/post-formats.php        2013-04-17 20:12:25 UTC (rev 24020)
+++ trunk/wp-includes/post-formats.php        2013-04-17 20:57:44 UTC (rev 24021)
</span><span class="lines">@@ -81,19 +81,45 @@
</span><span class="cx">  * @return array The array of post format metadata.
</span><span class="cx">  */
</span><span class="cx"> function get_post_format_meta( $post_id = 0 ) {
</span><del>-        $values = array(
-                'quote'        =&gt; '',
-                'quote_source' =&gt; '',
-                'url'          =&gt; '',
-                'image'        =&gt; '',
-                'gallery'      =&gt; '',
-                'audio'        =&gt; '',
-                'video'        =&gt; '',
</del><ins>+        $meta = get_post_meta( $post_id );
+        $keys = array( 'quote', 'quote_source_name', 'quote_source_url', 'link_url', 'gallery', 'audio_embed', 'video_embed', 'url', 'image' );
+
+        if ( empty( $meta ) )
+                return array_fill_keys( $keys, '' );
+
+        $upgrade = array(
+                '_wp_format_quote_source' =&gt; 'quote_source_name',
+                '_wp_format_audio' =&gt; 'audio_embed',
+                '_wp_format_video' =&gt; 'video_embed'
</ins><span class="cx">         );
</span><span class="cx"> 
</span><del>-        foreach ( $values as $key =&gt; $value )
-                $values[$key] = get_post_meta( $post_id, '_wp_format_' . $key, true );
</del><ins>+        $format = get_post_format( $post_id );
+        if ( ! empty( $format ) ) {
+                switch ( $format ) {
+                case 'link':
+                        $upgrade['_wp_format_url'] = 'link_url';
+                        break;
+                case 'quote':
+                        $upgrade['_wp_format_url'] = 'quote_source_url';
+                        break;
+                }
+        }
</ins><span class="cx"> 
</span><ins>+        $upgrade_keys = array_keys( $upgrade );
+        foreach ( $meta as $key =&gt; $values ) {
+                if ( ! in_array( $key, $upgrade_keys ) )
+                        continue;
+                update_post_meta( $post_id, '_format_' . $upgrade[$key], reset( $values ) );
+                delete_post_meta( $post_id, $key );
+        }
+
+        $values = array();
+
+        foreach ( $keys as $key ) {
+                $value = get_post_meta( $post_id, '_format_' . $key, true );
+                $values[$key] = empty( $value ) ? '' : $value;
+        }
+
</ins><span class="cx">         return $values;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -324,11 +350,11 @@
</span><span class="cx">                         $compat['tag'] = '';
</span><span class="cx">                         $compat['position'] = 'before';
</span><span class="cx"> 
</span><del>-                        if ( ! empty( $meta['url'] ) ) {
-                                $esc_url = preg_quote( $meta['url'], '#' );
</del><ins>+                        if ( ! empty( $meta['link_url'] ) ) {
+                                $esc_url = preg_quote( $meta['link_url'], '#' );
</ins><span class="cx">                                 // Make sure the same URL isn't in the post (modified/extended versions allowed)
</span><span class="cx">                                 if ( ! preg_match( '#' . $esc_url . '[^/&amp;\?]?#', $content ) ) {
</span><del>-                                        $url = $meta['url'];
</del><ins>+                                        $url = $meta['link_url'];
</ins><span class="cx">                                 } else {
</span><span class="cx">                                         $url = get_content_url( $content, true );
</span><span class="cx">                                 }
</span><span class="lines">@@ -344,7 +370,7 @@
</span><span class="cx">                                         '&lt;a %shref=&quot;%s&quot;&gt;%s&lt;/a&gt;',
</span><span class="cx">                                         empty( $compat['link_class'] ) ? '' : sprintf( 'class=&quot;%s&quot; ', esc_attr( $compat['link_class'] ) ),
</span><span class="cx">                                         esc_url( $url ),
</span><del>-                                        empty( $post-&gt;post_title ) ? esc_url( $meta['url'] ) : apply_filters( 'the_title', $post-&gt;post_title, $post-&gt;ID )
</del><ins>+                                        empty( $post-&gt;post_title ) ? esc_url( $meta['link_url'] ) : apply_filters( 'the_title', $post-&gt;post_title, $post-&gt;ID )
</ins><span class="cx">                                 );
</span><span class="cx">                          }
</span><span class="cx">                         break;
</span><span class="lines">@@ -375,8 +401,8 @@
</span><span class="cx">                 case 'quote':
</span><span class="cx">                         if ( ! empty( $meta['quote'] ) &amp;&amp; ! stristr( $content, $meta['quote'] ) ) {
</span><span class="cx">                                 $quote = sprintf( '&lt;blockquote&gt;%s&lt;/blockquote&gt;', wpautop( $meta['quote'] ) );
</span><del>-                                if ( ! empty( $meta['quote_source'] ) ) {
-                                        $source = ( empty( $meta['url'] ) ) ? $meta['quote_source'] : sprintf( '&lt;a href=&quot;%s&quot;&gt;%s&lt;/a&gt;', esc_url( $meta['url'] ), $meta['quote_source'] );
</del><ins>+                                if ( ! empty( $meta['quote_source_name'] ) ) {
+                                        $source = ( empty( $meta['quote_source_url'] ) ) ? $meta['quote_source_name'] : sprintf( '&lt;a href=&quot;%s&quot;&gt;%s&lt;/a&gt;', esc_url( $meta['quote_source_url'] ), $meta['quote_source_name'] );
</ins><span class="cx">                                         $quote .= sprintf( '&lt;figcaption class=&quot;quote-caption&quot;&gt;%s&lt;/figcaption&gt;', $source );
</span><span class="cx">                                 }
</span><span class="cx">                                 $format_output .= sprintf( '&lt;figure class=&quot;quote&quot;&gt;%s&lt;/figure&gt;', $quote );
</span><span class="lines">@@ -385,17 +411,18 @@
</span><span class="cx"> 
</span><span class="cx">                 case 'video':
</span><span class="cx">                 case 'audio':
</span><del>-                        if ( ! has_shortcode( $post-&gt;post_content, $format ) &amp;&amp; ! empty( $meta[$format] ) ) {
</del><ins>+                        if ( ! has_shortcode( $post-&gt;post_content, $format ) &amp;&amp; ! empty( $meta[$format . '_embed'] ) ) {
+                                $value = $meta[$format . '_embed'];
</ins><span class="cx">                                 // the metadata is an attachment ID
</span><del>-                                if ( is_numeric( $meta[$format] ) ) {
-                                        $url = wp_get_attachment_url( $meta[$format] );
</del><ins>+                                if ( is_numeric( $value ) ) {
+                                        $url = wp_get_attachment_url( $value );
</ins><span class="cx">                                         $format_output .= sprintf( '[%s src=&quot;%s&quot;]', $format, $url );
</span><span class="cx">                                 // the metadata is a shortcode or an embed code
</span><del>-                                } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $meta[$format] ) || preg_match( '#&lt;[^&gt;]+&gt;#', $meta[$format] ) ) {
-                                        $format_output .= $meta[$format];
-                                } elseif ( ! stristr( $content, $meta[$format] ) ) {
</del><ins>+                                } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $value ) || preg_match( '#&lt;[^&gt;]+&gt;#', $value ) ) {
+                                        $format_output .= $value;
+                                } elseif ( ! stristr( $content, $value ) ) {
</ins><span class="cx">                                         // attempt to embed the URL
</span><del>-                                        $format_output .= sprintf( '[embed]%s[/embed]', $meta[$format] );
</del><ins>+                                        $format_output .= sprintf( '[embed]%s[/embed]', $value );
</ins><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                         break;
</span><span class="lines">@@ -707,10 +734,28 @@
</span><span class="cx">         if ( empty( $post ) )
</span><span class="cx">                 return '';
</span><span class="cx"> 
</span><del>-        if ( in_array( get_post_format( $post-&gt;ID ), array( 'image', 'link', 'quote' ) ) ) {
</del><ins>+        $format = get_post_format( $post-&gt;ID );
+        if ( in_array( $format, array( 'image', 'link', 'quote' ) ) ) {
</ins><span class="cx">                 $meta = get_post_format_meta( $post-&gt;ID );
</span><del>-                if ( ! empty( $meta['url'] ) )
-                        return apply_filters( 'get_the_post_format_url', esc_url_raw( $meta['url'] ), $post );
</del><ins>+                $meta_link = '';
+
+                switch ( $format ) {
+                case 'link':
+                        if ( ! empty( $meta['link_url'] ) )
+                                $meta_link = $meta['link_url'];
+                        break;
+                case 'image':
+                        if ( ! empty( $meta['url'] ) )
+                                $meta_link = $meta['url'];
+                        break;
+                case 'quote':
+                        if ( ! empty( $meta['quote_source_url'] ) )
+                                $meta_link = $meta['quote_source_url'];
+                        break;
+                }
+
+                if ( ! empty( $meta_link ) )
+                        return apply_filters( 'get_the_post_format_url', esc_url_raw( $meta_link ), $post );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if ( ! empty( $post-&gt;post_content ) )
</span></span></pre></div>
<a id="trunkwpincludesrevisionphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/revision.php (24020 => 24021)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/revision.php        2013-04-17 20:12:25 UTC (rev 24020)
+++ trunk/wp-includes/revision.php        2013-04-17 20:57:44 UTC (rev 24021)
</span><span class="lines">@@ -68,13 +68,15 @@
</span><span class="cx">  */
</span><span class="cx"> function _wp_post_revision_meta_keys() {
</span><span class="cx">         return array(
</span><del>-                '_wp_format_url',
-                '_wp_format_quote',
-                '_wp_format_quote_source',
-                '_wp_format_image',
-                '_wp_format_gallery',
-                '_wp_format_audio',
-                '_wp_format_video',
</del><ins>+                '_format_url',
+                '_format_link_url',
+                '_format_quote_source_url',
+                '_format_quote_source_name',
+                '_format_quote',
+                '_format_image',
+                '_format_gallery',
+                '_format_audio_embed',
+                '_format_video_embed',
</ins><span class="cx">         );
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>