<!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">         <div class="field wp-format-quote">
</span><span class="cx">                 <label for="wp_format_quote"><?php _e( 'Quote' ); ?></label>
</span><del>-                <textarea id="wp_format_quote" name="_wp_format_quote" class="widefat"><?php echo esc_textarea( $format_meta['quote'] ); ?></textarea>
</del><ins>+                <textarea id="wp_format_quote" name="_format_quote" class="widefat"><?php echo esc_textarea( $format_meta['quote'] ); ?></textarea>
</ins><span class="cx">         </div>
</span><span class="cx">
</span><span class="cx">         <div class="field wp-format-quote">
</span><span class="cx">                 <label for="wp_format_quote_source"><?php _e( 'Quote source' ); ?></label>
</span><del>-                <input type="text" id="wp_format_quote_source" name="_wp_format_quote_source" value="<?php echo esc_attr( $format_meta['quote_source'] ); ?>" class="widefat" />
</del><ins>+                <input type="text" id="wp_format_quote_source" name="_format_quote_source_name" value="<?php echo esc_attr( $format_meta['quote_source_name'] ); ?>" class="widefat" />
</ins><span class="cx">         </div>
</span><span class="cx">
</span><span class="cx">         <div class="field wp-format-image">
</span><del>-                <?php if ( ! empty( $format_meta['image'] ) ) : ?>
</del><ins>+                <?php if ( ! empty( $format_meta['image'] ) ) :
+                        $value = $format_meta['image'];
+                ?>
</ins><span class="cx">                 <div id="image-preview" class="wp-format-media-preview">
</span><span class="cx">                         <?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( '<img src="%s" alt="%s" />', 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( '#<[^>]+>#', $format_meta['image'] ) ) {
-                                        printf( '<img src="%s" alt="" />', esc_url( $format_meta['image'] ) );
</del><ins>+                                } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $value ) ) {
+                                        echo do_shortcode( $value );
+                                } elseif ( ! preg_match( '#<[^>]+>#', $value ) ) {
+                                        printf( '<img src="%s" alt="" />', 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">                         ?>
</span><span class="cx">                 </div>
</span><span class="lines">@@ -43,7 +45,7 @@
</span><span class="cx">                         else
</span><span class="cx">                                 _e( 'Image URL' );
</span><span class="cx">                 ?></label>
</span><del>-                <textarea id="wp_format_image" type="text" name="_wp_format_image" class="widefat"><?php esc_html_e( $format_meta['image'] ); ?></textarea>
</del><ins>+                <textarea id="wp_format_image" type="text" name="_format_image" class="widefat"><?php esc_html_e( $format_meta['image'] ); ?></textarea>
</ins><span class="cx">                 <div data-format="image" class="wp-format-media-holder hide-if-no-js">
</span><span class="cx">                         <a href="#" class="wp-format-media-select"
</span><span class="cx">                                 data-choose="<?php esc_attr_e( 'Choose an Image' ); ?>"
</span><span class="lines">@@ -53,27 +55,39 @@
</span><span class="cx">                 </div>
</span><span class="cx">         </div>
</span><span class="cx">
</span><del>-        <div class="field wp-format-link wp-format-quote wp-format-image">
-                <label for="wp_format_url"><?php _e( 'Link URL' ); ?></label>
-                <input type="text" id="wp_format_url" name="_wp_format_url" value="<?php echo esc_url( $format_meta['url'] ); ?>" class="widefat" />
</del><ins>+        <div class="field wp-format-link">
+                <label for="wp_format_link_url"><?php _e( 'Link URL' ); ?></label>
+                <input type="text" id="wp_format_link_url" name="_format_link_url" value="<?php echo esc_url( $format_meta['link_url'] ); ?>" class="widefat" />
</ins><span class="cx">         </div>
</span><span class="cx">
</span><ins>+        <div class="field wp-format-quote">
+                <label for="wp_format_quote_source_url"><?php _e( 'Link URL' ); ?></label>
+                <input type="text" id="wp_format_quote_source_url" name="_format_quote_source_url" value="<?php echo esc_url( $format_meta['quote_source_url'] ); ?>" class="widefat" />
+        </div>
+
+        <div class="field wp-format-image">
+                <label for="wp_format_image_url"><?php _e( 'Link URL' ); ?></label>
+                <input type="text" id="wp_format_image_url" name="_format_url" value="<?php echo esc_url( $format_meta['url'] ); ?>" class="widefat" />
+        </div>
+
</ins><span class="cx">         <div class="field wp-format-video">
</span><del>-                <?php if ( ! empty( $format_meta['video'] ) ): ?>
</del><ins>+                <?php if ( ! empty( $format_meta['video_embed'] ) ):
+                        $value = $format_meta['video_embed'];
+                ?>
</ins><span class="cx">                 <div id="video-preview" class="wp-format-media-preview">
</span><span class="cx">                         <?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="%s"]', $url ) );
</span><del>-                                } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $format_meta['video'] ) ) {
-                                        echo do_shortcode( $format_meta['video'] );
-                                } elseif ( ! preg_match( '#<[^>]+>#', $format_meta['video'] ) ) {
-                                        if ( strstr( $format_meta['video'], home_url() ) )
-                                                echo do_shortcode( sprintf( '[video src="%s"]', $format_meta['video'] ) );
</del><ins>+                                } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $value ) ) {
+                                        echo do_shortcode( $value );
+                                } elseif ( ! preg_match( '#<[^>]+>#', $value ) ) {
+                                        if ( strstr( $value, home_url() ) )
+                                                echo do_shortcode( sprintf( '[video src="%s"]', $value ) );
</ins><span class="cx">                                         else
</span><del>-                                                echo $wp_embed->autoembed( $format_meta['video'] );
</del><ins>+                                                echo $wp_embed->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">                         ?>
</span><span class="cx">                 </div>
</span><span class="lines">@@ -84,7 +98,7 @@
</span><span class="cx">                         else
</span><span class="cx">                                 _e( 'Video URL' );
</span><span class="cx">                 ?></label>
</span><del>-                <textarea id="wp_format_video" type="text" name="_wp_format_video" class="widefat"><?php esc_html_e( $format_meta['video'] ); ?></textarea>
</del><ins>+                <textarea id="wp_format_video" type="text" name="_format_video_embed" class="widefat"><?php esc_html_e( $format_meta['video_embed'] ); ?></textarea>
</ins><span class="cx">                 <div data-format="video" class="wp-format-media-holder hide-if-no-js">
</span><span class="cx">                         <a href="#" class="wp-format-media-select"
</span><span class="cx">                                 data-choose="<?php esc_attr_e( 'Choose a Video' ); ?>"
</span><span class="lines">@@ -95,21 +109,23 @@
</span><span class="cx">         </div>
</span><span class="cx">
</span><span class="cx">         <div class="field wp-format-audio">
</span><del>-                <?php if ( ! empty( $format_meta['audio'] ) ): ?>
</del><ins>+                <?php if ( ! empty( $format_meta['audio_embed'] ) ):
+                        $value = $format_meta['audio_embed'];
+                ?>
</ins><span class="cx">                 <div id="audio-preview" class="wp-format-media-preview">
</span><span class="cx">                         <?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="%s"]', $url ) );
</span><del>-                                } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $format_meta['audio'] ) ) {
-                                        echo do_shortcode( $format_meta['audio'] );
-                                } elseif ( ! preg_match( '#<[^>]+>#', $format_meta['audio'] ) ) {
-                                        if ( strstr( $format_meta['audio'], home_url() ) )
-                                                echo do_shortcode( sprintf( '[audio src="%s"]', $format_meta['audio'] ) );
</del><ins>+                                } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $value ) ) {
+                                        echo do_shortcode( $value );
+                                } elseif ( ! preg_match( '#<[^>]+>#', $value ) ) {
+                                        if ( strstr( $value, home_url() ) )
+                                                echo do_shortcode( sprintf( '[audio src="%s"]', $value ) );
</ins><span class="cx">                                         else
</span><del>-                                                echo $wp_embed->autoembed( $format_meta['audio'] );
</del><ins>+                                                echo $wp_embed->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">                         ?>
</span><span class="cx">                 </div>
</span><span class="lines">@@ -120,7 +136,7 @@
</span><span class="cx">                         else
</span><span class="cx">                                 _e( 'Audio URL' );
</span><span class="cx">                 ?></label>
</span><del>-                <textarea id="wp_format_audio" name="_wp_format_audio" class="widefat"><?php esc_html_e( $format_meta['audio'] ); ?></textarea>
</del><ins>+                <textarea id="wp_format_audio" name="_format_audio_embed" class="widefat"><?php esc_html_e( $format_meta['audio_embed'] ); ?></textarea>
</ins><span class="cx">                 <div data-format="audio" class="wp-format-media-holder hide-if-no-js">
</span><span class="cx">                         <a href="#" class="wp-format-media-select" data-choose="<?php esc_attr_e( 'Choose Audio' ); ?>" data-update="<?php esc_attr_e( 'Select Audio' ); ?>">
</span><span class="cx">                                 <?php _e( 'Select Audio From Media Library' ) ?>
</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^="_wp_format_"], textarea[name^="_wp_format_"]').each( function(i, field) {
</del><ins>+        $('.post-formats-fields').find('input[name^="_format_"], textarea[name^="_format_"]').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->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="%s"]', $type, $url );
</span><del>-                        } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $meta[$type] ) ) {
-                                $shortcode = $meta[$type];
-                        } elseif ( preg_match( '#<[^>]+>#', $meta[$type] ) ) {
-                                $post->format_content = $meta[$type];
</del><ins>+                        } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $value ) ) {
+                                $shortcode = $value;
+                        } elseif ( preg_match( '#<[^>]+>#', $value ) ) {
+                                $post->format_content = $value;
</ins><span class="cx">                                 return $post->format_content;
</span><del>-                        } elseif ( 0 === strpos( $meta[$type], 'http' ) ) {
-                                $post->split_content = str_replace( $meta[$type], '', $post->post_content, $count );
-                                if ( strstr( $meta[$type], home_url() ) ) {
-                                        $shortcode = sprintf( '[%s src="%s"]', $type, $meta[$type] );
</del><ins>+                        } elseif ( 0 === strpos( $value, 'http' ) ) {
+                                $post->split_content = str_replace( $value, '', $post->post_content, $count );
+                                if ( strstr( $value, home_url() ) ) {
+                                        $shortcode = sprintf( '[%s src="%s"]', $type, $value );
</ins><span class="cx">                                 } else {
</span><del>-                                        $post->format_content = $wp_embed->autoembed( $meta[$type] );
</del><ins>+                                        $post->format_content = $wp_embed->autoembed( $value );
</ins><span class="cx">                                         return $post->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' => '',
-                'quote_source' => '',
-                'url' => '',
-                'image' => '',
-                'gallery' => '',
-                'audio' => '',
-                'video' => '',
</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' => 'quote_source_name',
+                '_wp_format_audio' => 'audio_embed',
+                '_wp_format_video' => 'video_embed'
</ins><span class="cx">         );
</span><span class="cx">
</span><del>-        foreach ( $values as $key => $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 => $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 . '[^/&\?]?#', $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">                                         '<a %shref="%s">%s</a>',
</span><span class="cx">                                         empty( $compat['link_class'] ) ? '' : sprintf( 'class="%s" ', esc_attr( $compat['link_class'] ) ),
</span><span class="cx">                                         esc_url( $url ),
</span><del>-                                        empty( $post->post_title ) ? esc_url( $meta['url'] ) : apply_filters( 'the_title', $post->post_title, $post->ID )
</del><ins>+                                        empty( $post->post_title ) ? esc_url( $meta['link_url'] ) : apply_filters( 'the_title', $post->post_title, $post->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'] ) && ! stristr( $content, $meta['quote'] ) ) {
</span><span class="cx">                                 $quote = sprintf( '<blockquote>%s</blockquote>', wpautop( $meta['quote'] ) );
</span><del>-                                if ( ! empty( $meta['quote_source'] ) ) {
-                                        $source = ( empty( $meta['url'] ) ) ? $meta['quote_source'] : sprintf( '<a href="%s">%s</a>', 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( '<a href="%s">%s</a>', esc_url( $meta['quote_source_url'] ), $meta['quote_source_name'] );
</ins><span class="cx">                                         $quote .= sprintf( '<figcaption class="quote-caption">%s</figcaption>', $source );
</span><span class="cx">                                 }
</span><span class="cx">                                 $format_output .= sprintf( '<figure class="quote">%s</figure>', $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->post_content, $format ) && ! empty( $meta[$format] ) ) {
</del><ins>+                        if ( ! has_shortcode( $post->post_content, $format ) && ! 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="%s"]', $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( '#<[^>]+>#', $meta[$format] ) ) {
-                                        $format_output .= $meta[$format];
-                                } elseif ( ! stristr( $content, $meta[$format] ) ) {
</del><ins>+                                } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $value ) || preg_match( '#<[^>]+>#', $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->ID ), array( 'image', 'link', 'quote' ) ) ) {
</del><ins>+        $format = get_post_format( $post->ID );
+        if ( in_array( $format, array( 'image', 'link', 'quote' ) ) ) {
</ins><span class="cx">                 $meta = get_post_format_meta( $post->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->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>