<!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>[24092] trunk: Screen option for Post Format UI.</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 { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { 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/24092">24092</a></dd>
<dt>Author</dt> <dd>markjaquith</dd>
<dt>Date</dt> <dd>2013-04-25 07:28:33 +0000 (Thu, 25 Apr 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Screen option for Post Format UI.

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

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminadminajaxphp">trunk/wp-admin/admin-ajax.php</a></li>
<li><a href="#trunkwpadmincsswpadmincss">trunk/wp-admin/css/wp-admin.css</a></li>
<li><a href="#trunkwpadmineditformadvancedphp">trunk/wp-admin/edit-form-advanced.php</a></li>
<li><a href="#trunkwpadminincludesajaxactionsphp">trunk/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunkwpadminincludespostformatsphp">trunk/wp-admin/includes/post-formats.php</a></li>
<li><a href="#trunkwpadminincludesscreenphp">trunk/wp-admin/includes/screen.php</a></li>
<li><a href="#trunkwpadminjspostformatsjs">trunk/wp-admin/js/post-formats.js</a></li>
<li><a href="#trunkwpincludesuserphp">trunk/wp-includes/user.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminadminajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-ajax.php (24091 => 24092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-ajax.php        2013-04-25 07:10:35 UTC (rev 24091)
+++ trunk/wp-admin/admin-ajax.php        2013-04-25 07:28:33 UTC (rev 24092)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">         'save-widget', 'set-post-thumbnail', 'date_format', 'time_format', 'wp-fullscreen-save-post',
</span><span class="cx">         'wp-remove-post-lock', 'dismiss-wp-pointer', 'upload-attachment', 'get-attachment',
</span><span class="cx">         'query-attachments', 'save-attachment', 'save-attachment-compat', 'send-link-to-editor',
</span><del>-        'send-attachment-to-editor', 'save-attachment-order', 'heartbeat'
</del><ins>+        'send-attachment-to-editor', 'save-attachment-order', 'heartbeat', 'show-post-format-ui',
</ins><span class="cx"> );
</span><span class="cx"> 
</span><span class="cx"> // Register core Ajax calls.
</span></span></pre></div>
<a id="trunkwpadmincsswpadmincss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/wp-admin.css (24091 => 24092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/wp-admin.css        2013-04-25 07:10:35 UTC (rev 24091)
+++ trunk/wp-admin/css/wp-admin.css        2013-04-25 07:28:33 UTC (rev 24092)
</span><span class="lines">@@ -3938,6 +3938,10 @@
</span><span class="cx">         padding-bottom: 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.no-ui {
+        display: none;
+}
+
</ins><span class="cx"> .post-formats-fields {
</span><span class="cx">         display: none;
</span><span class="cx">         margin-bottom: 15px;
</span></span></pre></div>
<a id="trunkwpadmineditformadvancedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-form-advanced.php (24091 => 24092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-form-advanced.php        2013-04-25 07:10:35 UTC (rev 24091)
+++ trunk/wp-admin/edit-form-advanced.php        2013-04-25 07:28:33 UTC (rev 24092)
</span><span class="lines">@@ -146,6 +146,15 @@
</span><span class="cx">                         $post_format_set_class = '';
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        $user_wants = get_user_option( 'post_formats_' . $post_type );
+        if ( false !== $user_wants ) {
+                // User wants what user gets.
+                $show_post_format_ui = (bool) $user_wants;
+        } else {
+                // UI is shown when the theme supports formats, or if the site has formats assigned to posts.
+                $show_post_format_ui = current_theme_supports( 'post-formats' ) || get_terms( 'post_format', array( 'number' =&gt; 1 ) );
+        }
+
</ins><span class="cx">         $format_class = &quot; class='wp-format-{$post_format}'&quot;;
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -383,8 +392,10 @@
</span><span class="cx">         &lt;p&gt;&lt;?php _e(&quot;You have lost your connection with the server, and saving has been disabled. This message will vanish once you've reconnected.&quot;); ?&gt;&lt;/p&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> &lt;?php if ( ! empty( $post_format_options ) ) : ?&gt;
</span><del>-&lt;div class=&quot;post-format-options&quot;&gt;
-        &lt;?php echo $post_format_options; ?&gt;
</del><ins>+&lt;div class=&quot;wp-post-format-ui&lt;?php if ( ! $show_post_format_ui ) echo ' no-ui' ?&gt;&quot;&gt;
+        &lt;div class=&quot;post-format-options&quot;&gt;
+                &lt;?php echo $post_format_options; ?&gt;
+        &lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> &lt;?php endif; ?&gt;
</span><span class="cx"> &lt;form name=&quot;post&quot; action=&quot;post.php&quot; method=&quot;post&quot; id=&quot;post&quot;&lt;?php do_action('post_edit_form_tag'); ?&gt;&gt;
</span></span></pre></div>
<a id="trunkwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/ajax-actions.php (24091 => 24092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/ajax-actions.php        2013-04-25 07:10:35 UTC (rev 24091)
+++ trunk/wp-admin/includes/ajax-actions.php        2013-04-25 07:28:33 UTC (rev 24092)
</span><span class="lines">@@ -1135,6 +1135,25 @@
</span><span class="cx">         wp_die( 1 );
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function wp_ajax_show_post_format_ui() {
+        error_log( serialize( $_REQUEST ) );
+
+        if ( empty( $_POST['post_type'] ) )
+                wp_die( 0 );
+
+        check_ajax_referer( 'show-post-format-ui_' . $_POST['post_type'], 'nonce' );
+
+        if ( ! $post_type_object = get_post_type_object( $_POST['post_type'] ) )
+                wp_die( 0 );
+
+        if ( ! current_user_can( $post_type_object-&gt;cap-&gt;edit_posts ) )
+                wp_die( -1 );
+
+        update_user_option( get_current_user_id(), 'post_formats_' . $post_type_object-&gt;name, empty( $_POST['show'] ) ? 0 : 1 );
+
+        wp_die( 1 );
+}
+
</ins><span class="cx"> function wp_ajax_hidden_columns() {
</span><span class="cx">         check_ajax_referer( 'screen-options-nonce', 'screenoptionnonce' );
</span><span class="cx">         $hidden = isset( $_POST['hidden'] ) ? $_POST['hidden'] : '';
</span></span></pre></div>
<a id="trunkwpadminincludespostformatsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/post-formats.php (24091 => 24092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/post-formats.php        2013-04-25 07:10:35 UTC (rev 24091)
+++ trunk/wp-admin/includes/post-formats.php        2013-04-25 07:28:33 UTC (rev 24092)
</span><span class="lines">@@ -1,140 +1,147 @@
</span><span class="cx"> &lt;?php
</span><ins>+
+defined( 'ABSPATH' ) or die;
+
</ins><span class="cx"> global $wp_embed;
</span><span class="cx"> 
</span><span class="cx"> $format_meta = get_post_format_meta( $post_ID );
</span><span class="cx"> 
</span><ins>+wp_nonce_field( 'show-post-format-ui_' . $post_type, 'show_post_format_ui_nonce', false );
+
</ins><span class="cx"> ?&gt;
</span><del>-&lt;div class=&quot;post-format-change&quot;&gt;&lt;span class=&quot;icon &lt;?php echo esc_attr( $post_format ); ?&gt;&quot;&gt;&lt;/span&gt; &lt;span class=&quot;post-format-description&quot;&gt;&lt;?php echo $all_post_formats[$post_format]['description']; ?&gt;&lt;/span&gt; &lt;a href=&quot;#&quot;&gt;&lt;?php _e('Change format'); ?&gt;&lt;/a&gt;&lt;/div&gt;
-&lt;div class=&quot;post-formats-fields&quot;&gt;
</del><ins>+&lt;div class=&quot;wp-post-format-ui&lt;?php if ( ! $show_post_format_ui ) echo ' no-ui' ?&gt;&quot;&gt;
+        &lt;div class=&quot;post-format-change&quot;&gt;&lt;span class=&quot;icon &lt;?php echo esc_attr( $post_format ); ?&gt;&quot;&gt;&lt;/span&gt; &lt;span class=&quot;post-format-description&quot;&gt;&lt;?php echo $all_post_formats[$post_format]['description']; ?&gt;&lt;/span&gt; &lt;a href=&quot;#&quot;&gt;&lt;?php _e('Change format'); ?&gt;&lt;/a&gt;&lt;/div&gt;
+        &lt;div class=&quot;post-formats-fields&quot;&gt;
</ins><span class="cx"> 
</span><del>-        &lt;input type=&quot;hidden&quot; name=&quot;post_format&quot; id=&quot;post_format&quot; value=&quot;&lt;?php echo esc_attr( $post_format ); ?&gt;&quot; /&gt;
</del><ins>+                &lt;input type=&quot;hidden&quot; name=&quot;post_format&quot; id=&quot;post_format&quot; value=&quot;&lt;?php echo esc_attr( $post_format ); ?&gt;&quot; /&gt;
</ins><span class="cx"> 
</span><del>-        &lt;div class=&quot;field wp-format-quote&quot;&gt;
-                &lt;label for=&quot;wp_format_quote_source&quot;&gt;&lt;?php _e( 'Quote source' ); ?&gt;&lt;/label&gt;
-                &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;
-        &lt;/div&gt;
</del><ins>+                &lt;div class=&quot;field wp-format-quote&quot;&gt;
+                        &lt;label for=&quot;wp_format_quote_source&quot;&gt;&lt;?php _e( 'Quote source' ); ?&gt;&lt;/label&gt;
+                        &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;
+                &lt;/div&gt;
</ins><span class="cx"> 
</span><del>-        &lt;div class=&quot;field wp-format-image&quot;&gt;
-                &lt;?php if ( ! empty( $format_meta['image'] ) ) :
-                        $value = $format_meta['image'];
-                ?&gt;
-                &lt;div id=&quot;image-preview&quot; class=&quot;wp-format-media-preview&quot;&gt;
-                        &lt;?php
-                                if ( is_numeric( $value ) ) {
-                                        $image = wp_get_attachment_url( $value );
-                                        printf( '&lt;img src=&quot;%s&quot; alt=&quot;%s&quot; /&gt;', esc_url( $image ), get_the_title( $value ) );
-                                } 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 ) );
-                                } else {
-                                        echo $value;
-                                }
</del><ins>+                &lt;div class=&quot;field wp-format-image&quot;&gt;
+                        &lt;?php if ( ! empty( $format_meta['image'] ) ) :
+                                $value = $format_meta['image'];
</ins><span class="cx">                         ?&gt;
</span><ins>+                        &lt;div id=&quot;image-preview&quot; class=&quot;wp-format-media-preview&quot;&gt;
+                                &lt;?php
+                                        if ( is_numeric( $value ) ) {
+                                                $image = wp_get_attachment_url( $value );
+                                                printf( '&lt;img src=&quot;%s&quot; alt=&quot;%s&quot; /&gt;', esc_url( $image ), get_the_title( $value ) );
+                                        } 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 ) );
+                                        } else {
+                                                echo $value;
+                                        }
+                                ?&gt;
+                        &lt;/div&gt;
+                        &lt;?php endif ?&gt;
+                        &lt;label for=&quot;wp_format_image&quot;&gt;&lt;?php
+                                if ( current_user_can( 'unfiltered_html' ) )
+                                        _e( 'Image HTML or URL' );
+                                else
+                                        _e( 'Image URL' );
+                        ?&gt;&lt;/label&gt;
+                        &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;
+                        &lt;div data-format=&quot;image&quot; class=&quot;wp-format-media-holder hide-if-no-js&quot;&gt;
+                                &lt;a href=&quot;#&quot; class=&quot;wp-format-media-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 _e( 'Select / Upload Image' ); ?&gt;
+                                &lt;/a&gt;
+                        &lt;/div&gt;
</ins><span class="cx">                 &lt;/div&gt;
</span><del>-                &lt;?php endif ?&gt;
-                &lt;label for=&quot;wp_format_image&quot;&gt;&lt;?php
-                        if ( current_user_can( 'unfiltered_html' ) )
-                                _e( 'Image HTML or URL' );
-                        else
-                                _e( 'Image URL' );
-                ?&gt;&lt;/label&gt;
-                &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;
-                &lt;div data-format=&quot;image&quot; class=&quot;wp-format-media-holder hide-if-no-js&quot;&gt;
-                        &lt;a href=&quot;#&quot; class=&quot;wp-format-media-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 _e( 'Select / Upload Image' ); ?&gt;
-                        &lt;/a&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><del>-        &lt;/div&gt;
</del><span class="cx"> 
</span><del>-        &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;
-        &lt;/div&gt;
</del><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;
</ins><span class="cx"> 
</span><del>-        &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;
</del><ins>+                &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"> 
</span><del>-        &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;
-
-        &lt;div class=&quot;field wp-format-video&quot;&gt;
-                &lt;?php if ( ! empty( $format_meta['video_embed'] ) ):
-                        $value = $format_meta['video_embed'];
-                ?&gt;
-                &lt;div id=&quot;video-preview&quot; class=&quot;wp-format-media-preview&quot;&gt;
-                        &lt;?php
-                                if ( is_numeric( $value ) ) {
-                                        $video = wp_get_attachment_url( $value );
-                                        echo do_shortcode( sprintf( '[video src=&quot;%s&quot;]', $video ) );
-                                } 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 ) );
-                                        else
-                                                echo $wp_embed-&gt;autoembed( $value );
-                                } else {
-                                        echo $value;
-                                }
</del><ins>+                &lt;div class=&quot;field wp-format-video&quot;&gt;
+                        &lt;?php if ( ! empty( $format_meta['video_embed'] ) ):
+                                $value = $format_meta['video_embed'];
</ins><span class="cx">                         ?&gt;
</span><ins>+                        &lt;div id=&quot;video-preview&quot; class=&quot;wp-format-media-preview&quot;&gt;
+                                &lt;?php
+                                        if ( is_numeric( $value ) ) {
+                                                $video = wp_get_attachment_url( $value );
+                                                echo do_shortcode( sprintf( '[video src=&quot;%s&quot;]', $video ) );
+                                        } 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 ) );
+                                                else
+                                                        echo $wp_embed-&gt;autoembed( $value );
+                                        } else {
+                                                echo $value;
+                                        }
+                                ?&gt;
+                        &lt;/div&gt;
+                        &lt;?php endif; ?&gt;
+                        &lt;label for=&quot;wp_format_video&quot;&gt;&lt;?php
+                                if ( current_user_can( 'unfiltered_html' ) )
+                                        _e( 'Video embed code or URL' );
+                                else
+                                        _e( 'Video URL' );
+                        ?&gt;&lt;/label&gt;
+                        &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;
+                        &lt;div data-format=&quot;video&quot; class=&quot;wp-format-media-holder hide-if-no-js&quot;&gt;
+                                &lt;a href=&quot;#&quot; class=&quot;wp-format-media-select&quot;
+                                        data-choose=&quot;&lt;?php esc_attr_e( 'Choose a Video' ); ?&gt;&quot;
+                                        data-update=&quot;&lt;?php esc_attr_e( 'Select Video' ); ?&gt;&quot;&gt;
+                                        &lt;?php _e( 'Select Video From Media Library' ) ?&gt;
+                                &lt;/a&gt;
+                        &lt;/div&gt;
</ins><span class="cx">                 &lt;/div&gt;
</span><del>-                &lt;?php endif; ?&gt;
-                &lt;label for=&quot;wp_format_video&quot;&gt;&lt;?php
-                        if ( current_user_can( 'unfiltered_html' ) )
-                                _e( 'Video embed code or URL' );
-                        else
-                                _e( 'Video URL' );
-                ?&gt;&lt;/label&gt;
-                &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;
-                &lt;div data-format=&quot;video&quot; class=&quot;wp-format-media-holder hide-if-no-js&quot;&gt;
-                        &lt;a href=&quot;#&quot; class=&quot;wp-format-media-select&quot;
-                                data-choose=&quot;&lt;?php esc_attr_e( 'Choose a Video' ); ?&gt;&quot;
-                                data-update=&quot;&lt;?php esc_attr_e( 'Select Video' ); ?&gt;&quot;&gt;
-                                &lt;?php _e( 'Select Video From Media Library' ) ?&gt;
-                        &lt;/a&gt;
-                &lt;/div&gt;
-        &lt;/div&gt;
</del><span class="cx"> 
</span><del>-        &lt;div class=&quot;field wp-format-audio&quot;&gt;
-                &lt;?php if ( ! empty( $format_meta['audio_embed'] ) ):
-                        $value = $format_meta['audio_embed'];
-                ?&gt;
-                &lt;div id=&quot;audio-preview&quot; class=&quot;wp-format-media-preview&quot;&gt;
-                        &lt;?php
-                                if ( is_numeric( $value ) ) {
-                                        $audio = wp_get_attachment_url( $value );
-                                        echo do_shortcode( sprintf( '[audio src=&quot;%s&quot;]', $audio ) );
-                                } 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 ) );
-                                        else
-                                                echo $wp_embed-&gt;autoembed( $value );
-                                } else {
-                                        echo $value;
-                                }
</del><ins>+                &lt;div class=&quot;field wp-format-audio&quot;&gt;
+                        &lt;?php if ( ! empty( $format_meta['audio_embed'] ) ):
+                                $value = $format_meta['audio_embed'];
</ins><span class="cx">                         ?&gt;
</span><ins>+                        &lt;div id=&quot;audio-preview&quot; class=&quot;wp-format-media-preview&quot;&gt;
+                                &lt;?php
+                                        if ( is_numeric( $value ) ) {
+                                                $audio = wp_get_attachment_url( $value );
+                                                echo do_shortcode( sprintf( '[audio src=&quot;%s&quot;]', $audio ) );
+                                        } 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 ) );
+                                                else
+                                                        echo $wp_embed-&gt;autoembed( $value );
+                                        } else {
+                                                echo $value;
+                                        }
+                                ?&gt;
+                        &lt;/div&gt;
+                        &lt;?php endif; ?&gt;
+                        &lt;label for=&quot;wp_format_audio&quot;&gt;&lt;?php
+                                if ( current_user_can( 'unfiltered_html' ) )
+                                        _e( 'Audio embed code or URL' );
+                                else
+                                        _e( 'Audio URL' );
+                        ?&gt;&lt;/label&gt;
+                        &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;
+                        &lt;div data-format=&quot;audio&quot; class=&quot;wp-format-media-holder hide-if-no-js&quot;&gt;
+                                &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;
+                                        &lt;?php _e( 'Select Audio From Media Library' ) ?&gt;
+                                &lt;/a&gt;
+                        &lt;/div&gt;
</ins><span class="cx">                 &lt;/div&gt;
</span><del>-                &lt;?php endif; ?&gt;
-                &lt;label for=&quot;wp_format_audio&quot;&gt;&lt;?php
-                        if ( current_user_can( 'unfiltered_html' ) )
-                                _e( 'Audio embed code or URL' );
-                        else
-                                _e( 'Audio URL' );
-                ?&gt;&lt;/label&gt;
-                &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;
-                &lt;div data-format=&quot;audio&quot; class=&quot;wp-format-media-holder hide-if-no-js&quot;&gt;
-                        &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;
-                                &lt;?php _e( 'Select Audio From Media Library' ) ?&gt;
-                        &lt;/a&gt;
-                &lt;/div&gt;
</del><span class="cx">         &lt;/div&gt;
</span><del>-&lt;/div&gt;
</del><ins>+&lt;/div&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminincludesscreenphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/screen.php (24091 => 24092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/screen.php        2013-04-25 07:10:35 UTC (rev 24091)
+++ trunk/wp-admin/includes/screen.php        2013-04-25 07:28:33 UTC (rev 24092)
</span><span class="lines">@@ -962,6 +962,18 @@
</span><span class="cx">                                                 echo '&lt;label for=&quot;wp_welcome_panel-hide&quot;&gt;';
</span><span class="cx">                                                 echo '&lt;input type=&quot;checkbox&quot; id=&quot;wp_welcome_panel-hide&quot;' . checked( (bool) $welcome_checked, true, false ) . ' /&gt;';
</span><span class="cx">                                                 echo _x( 'Welcome', 'Welcome panel' ) . &quot;&lt;/label&gt;\n&quot;;
</span><ins>+                                        } elseif ( 'post' == $this-&gt;base &amp;&amp; post_type_supports( $this-&gt;post_type, 'post-formats' ) &amp;&amp; apply_filters( 'enable_post_format_ui', true, $GLOBALS['post'] ) ) {
+                                                $user_wants = get_user_option( 'post_formats_' . $this-&gt;post_type );
+                                                if ( false !== $user_wants ) {
+                                                        // User wants what user gets.
+                                                        $show_post_format_ui = (bool) $user_wants;
+                                                } else {
+                                                        // UI is shown when the theme supports formats, or if the site has formats assigned to posts.
+                                                        $show_post_format_ui = current_theme_supports( 'post-formats' ) || get_terms( 'post_format', array( 'number' =&gt; 1 ) );
+                                                }
+                                                echo '&lt;label for=&quot;show_post_format_ui&quot;&gt;';
+                                                echo '&lt;input type=&quot;checkbox&quot; id=&quot;show_post_format_ui&quot;' . checked( $show_post_format_ui, true, false ) . ' /&gt;';
+                                                echo __( 'Post Formats' ) . &quot;&lt;/label&gt;\n&quot;;
</ins><span class="cx">                                         }
</span><span class="cx">                                 ?&gt;
</span><span class="cx">                                 &lt;br class=&quot;clear&quot; /&gt;
</span></span></pre></div>
<a id="trunkwpadminjspostformatsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/post-formats.js (24091 => 24092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/post-formats.js        2013-04-25 07:10:35 UTC (rev 24091)
+++ trunk/wp-admin/js/post-formats.js        2013-04-25 07:28:33 UTC (rev 24092)
</span><span class="lines">@@ -109,6 +109,16 @@
</span><span class="cx">                         resizeContent( initialFormat, true );
</span><span class="cx">                 }
</span><span class="cx"> 
</span><ins>+                $('#show_post_format_ui').on('change', function() {
+                        $('.wp-post-format-ui').toggleClass('no-ui', ! this.checked );
+                        $.post( ajaxurl, {
+                                action: 'show-post-format-ui',
+                                post_type: $('#post_type').val(),
+                                show: this.checked ? 1 : 0,
+                                nonce: $('#show_post_format_ui_nonce').val()
+                        });
+                });
+
</ins><span class="cx">                 $('.post-format-change a').click(function() {
</span><span class="cx">                         $('.post-formats-fields, .post-format-change').slideUp();
</span><span class="cx">                         $('.post-format-options').slideDown();
</span></span></pre></div>
<a id="trunkwpincludesuserphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/user.php (24091 => 24092)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/user.php        2013-04-25 07:10:35 UTC (rev 24091)
+++ trunk/wp-includes/user.php        2013-04-25 07:28:33 UTC (rev 24092)
</span><span class="lines">@@ -276,11 +276,6 @@
</span><span class="cx">         if ( !$global )
</span><span class="cx">                 $option_name = $wpdb-&gt;prefix . $option_name;
</span><span class="cx"> 
</span><del>-        // For backward compatibility. See differences between update_user_meta() and deprecated update_usermeta().
-        // http://core.trac.wordpress.org/ticket/13088
-        if ( is_null( $newvalue ) || is_scalar( $newvalue ) &amp;&amp; empty( $newvalue ) )
-                return delete_user_meta( $user_id, $option_name );
-
</del><span class="cx">         return update_user_meta( $user_id, $option_name, $newvalue );
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>