Ticket #23930: 23930.diff
File 23930.diff, 6.8 KB (added by , 11 years ago) |
---|
-
wp-includes/user.php
276 276 if ( !$global ) 277 277 $option_name = $wpdb->prefix . $option_name; 278 278 279 // For backward compatibility. See differences between update_user_meta() and deprecated update_usermeta().280 // http://core.trac.wordpress.org/ticket/13088281 if ( is_null( $newvalue ) || is_scalar( $newvalue ) && empty( $newvalue ) )282 return delete_user_meta( $user_id, $option_name );283 284 279 return update_user_meta( $user_id, $option_name, $newvalue ); 285 280 } 286 281 -
wp-content/themes/twentythirteen/functions.php
84 84 * Structured post formats are formats where Twenty Thirteen handles the 85 85 * output instead of the default core HTML output. 86 86 */ 87 add_theme_support( 'structured-post-formats', array(88 'link', 'video'89 ) );90 add_theme_support( 'post-formats', array(91 'aside', 'audio', 'chat', 'gallery', 'image', 'quote', 'status'92 ) );87 //add_theme_support( 'structured-post-formats', array( 88 // 'link', 'video' 89 //) ); 90 //add_theme_support( 'post-formats', array( 91 // 'aside', 'audio', 'chat', 'gallery', 'image', 'quote', 'status' 92 //) ); 93 93 94 94 // This theme uses wp_nav_menu() in one location. 95 95 register_nav_menu( 'primary', __( 'Navigation Menu', 'twentythirteen' ) ); -
wp-admin/admin-ajax.php
56 56 'save-widget', 'set-post-thumbnail', 'date_format', 'time_format', 'wp-fullscreen-save-post', 57 57 'wp-remove-post-lock', 'dismiss-wp-pointer', 'upload-attachment', 'get-attachment', 58 58 'query-attachments', 'save-attachment', 'save-attachment-compat', 'send-link-to-editor', 59 'send-attachment-to-editor', 'save-attachment-order', 'heartbeat' 59 'send-attachment-to-editor', 'save-attachment-order', 'heartbeat', 'show-post-format-ui', 60 60 ); 61 61 62 62 // Register core Ajax calls. -
wp-admin/includes/ajax-actions.php
1135 1135 wp_die( 1 ); 1136 1136 } 1137 1137 1138 function wp_ajax_show_post_format_ui() { 1139 error_log( serialize( $_REQUEST ) ); 1140 1141 if ( empty( $_POST['post_type'] ) ) 1142 wp_die( 0 ); 1143 1144 check_ajax_referer( 'show-post-format-ui_' . $_POST['post_type'], 'nonce' ); 1145 1146 if ( ! $post_type_object = get_post_type_object( $_POST['post_type'] ) ) 1147 wp_die( 0 ); 1148 1149 if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) 1150 wp_die( -1 ); 1151 1152 error_log( 'Update post_formats_' . $post_type_object->name . ' option for ' . get_current_user_id() . ' to ' . ( empty( $_POST['show'] ) ? 0 : 1 ) ); 1153 1154 update_user_option( get_current_user_id(), 'post_formats_' . $post_type_object->name, empty( $_POST['show'] ) ? 0 : 1 ); 1155 1156 wp_die( 1 ); 1157 } 1158 1138 1159 function wp_ajax_hidden_columns() { 1139 1160 check_ajax_referer( 'screen-options-nonce', 'screenoptionnonce' ); 1140 1161 $hidden = isset( $_POST['hidden'] ) ? $_POST['hidden'] : ''; -
wp-admin/includes/post-formats.php
1 1 <?php 2 3 defined( 'ABSPATH' ) or die; 4 2 5 global $wp_embed; 3 6 4 7 $format_meta = get_post_format_meta( $post_ID ); 5 8 9 wp_nonce_field( 'show-post-format-ui_' . $post_type, 'show_post_format_ui_nonce', false ); 10 6 11 ?> 7 12 <div class="post-format-change"><span class="icon <?php echo esc_attr( $post_format ); ?>"></span> <span class="post-format-description"><?php echo $all_post_formats[$post_format]['description']; ?></span> <a href="#"><?php _e('Change format'); ?></a></div> 8 13 <div class="post-formats-fields"> -
wp-admin/includes/screen.php
960 960 echo '<label for="wp_welcome_panel-hide">'; 961 961 echo '<input type="checkbox" id="wp_welcome_panel-hide"' . checked( (bool) $welcome_checked, true, false ) . ' />'; 962 962 echo _x( 'Welcome', 'Welcome panel' ) . "</label>\n"; 963 } elseif ( 'post' == $this->base && post_type_supports( $this->post_type, 'post-formats' ) && apply_filters( 'enable_post_format_ui', true, $GLOBALS['post'] ) ) { 964 $user_wants = get_user_option( 'post_formats_' . $this->post_type ); 965 if ( false !== $user_wants ) { 966 // User wants what user gets. 967 $show_post_format_ui = (bool) $user_wants; 968 } else { 969 // UI is shown when the theme supports formats, or if the site has formats assigned to posts. 970 $show_post_format_ui = current_theme_supports( 'post-formats' ) || get_terms( 'post_format', array( 'number' => 1 ) ); 971 } 972 echo '<label for="show_post_format_ui">'; 973 echo '<input type="checkbox" id="show_post_format_ui"' . checked( $show_post_format_ui, true, false ) . ' />'; 974 echo __( 'Post Formats' ) . "</label>\n"; 963 975 } 964 976 ?> 965 977 <br class="clear" /> -
wp-admin/js/post-formats.js
64 64 65 65 $(function(){ 66 66 67 $('#show_post_format_ui').on('change', function() { 68 $('.some-element').toggleClass('.no-ui', ! this.checked ); 69 $.post( ajaxurl, { 70 action: 'show-post-format-ui', 71 post_type: $('#post_type').val(), 72 show: this.checked ? 1 : 0, 73 nonce: $('#show_post_format_ui_nonce').val() 74 }); 75 }); 76 67 77 $('.post-format-change a').click(function() { 68 78 $('.post-formats-fields, .post-format-change').slideUp(); 69 79 $('.post-format-options').slideDown(); -
wp-admin/edit-form-advanced.php
143 143 $post_format_set_class = ''; 144 144 } 145 145 146 $user_wants = get_user_option( 'post_formats_' . $post_type ); 147 if ( false !== $user_wants ) { 148 // User wants what user gets. 149 $show_post_format_ui = (bool) $user_wants; 150 } else { 151 // UI is shown when the theme supports formats, or if the site has formats assigned to posts. 152 $show_post_format_ui = current_theme_supports( 'post-formats' ) || get_terms( 'post_format', array( 'number' => 1 ) ); 153 } 154 155 // Use $show_post_format_ui to set a class. 156 146 157 $format_class = " class='wp-format-{$post_format}'"; 147 158 148 159