Ticket #20345: 20345.3.patch
File 20345.3.patch, 2.4 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/class-wp-media-list-table.php
130 130 $posts_columns['icon'] = ''; 131 131 /* translators: column name */ 132 132 $posts_columns['title'] = _x( 'File', 'column name' ); 133 $posts_columns['author'] = __( 'Author' );134 //$posts_columns['tags'] = _x( 'Tags', 'column name' );133 if ( _get_user_count() > 1 ) 134 $posts_columns['author'] = __( 'Author' ); 135 135 /* translators: column name */ 136 136 if ( !$this->detached ) { 137 137 $posts_columns['parent'] = _x( 'Attached to', 'column name' ); -
wp-admin/includes/class-wp-posts-list-table.php
266 266 /* translators: manage posts column name */ 267 267 $posts_columns['title'] = _x( 'Title', 'column name' ); 268 268 269 if ( post_type_supports( $post_type, 'author' ) ) 269 $total_users = isset( $_POST['total_users'] ) ? (int) $_POST['total_users'] : _get_user_count(); 270 if ( post_type_supports( $post_type, 'author' ) && $total_users > 1 ) 270 271 $posts_columns['author'] = __( 'Author' ); 271 272 272 273 if ( empty( $post_type ) || is_object_in_taxonomy( $post_type, 'category' ) ) … … 1043 1044 } ?> 1044 1045 <input type="hidden" name="post_view" value="<?php echo esc_attr( $m ); ?>" /> 1045 1046 <input type="hidden" name="screen" value="<?php echo esc_attr( $screen->id ); ?>" /> 1047 <input type="hidden" name="total_users" value="<?php echo esc_attr( _get_user_count() ); ?>" /> 1046 1048 <span class="error" style="display:none"></span> 1047 1049 <br class="clear" /> 1048 1050 </p> -
wp-includes/functions.php
3693 3693 } 3694 3694 } 3695 3695 3696 /** 3697 * Retrieve the total number of users in the DB. 3698 * 3699 * @since 3.4.0 3700 * @access private 3701 * 3702 * @return int Number of users. 3703 */ 3704 function _get_user_count() { 3705 global $wpdb; 3706 3707 if ( ! $user_count = wp_cache_get( 'user_count', 'users' ) ) { 3708 $user_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->users" ); 3709 wp_cache_add( 'user_count', $user_count, 'users' ); 3710 } 3711 3712 return $user_count; 3713 }