- Timestamp:
- 09/26/2015 06:50:03 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-posts-list-table.php
r34383 r34584 80 80 $post_type = $this->screen->post_type; 81 81 $post_type_object = get_post_type_object( $post_type ); 82 $exclude_states = get_post_stati( array( 83 'show_in_admin_all_list' => false, 84 ) ); 85 $this->user_posts_count = $wpdb->get_var( $wpdb->prepare( " 86 SELECT COUNT( 1 ) 87 FROM $wpdb->posts 88 WHERE post_type = %s 89 AND post_status NOT IN ( '" . implode( "','", $exclude_states ) . "' ) 90 AND post_author = %d 91 ", $post_type, get_current_user_id() ) ); 82 83 if ( is_multi_author() ) { 84 $exclude_states = get_post_stati( array( 85 'show_in_admin_all_list' => false, 86 ) ); 87 $this->user_posts_count = $wpdb->get_var( $wpdb->prepare( " 88 SELECT COUNT( 1 ) 89 FROM $wpdb->posts 90 WHERE post_type = %s 91 AND post_status NOT IN ( '" . implode( "','", $exclude_states ) . "' ) 92 AND post_author = %d 93 ", $post_type, get_current_user_id() ) ); 94 } 92 95 93 96 if ( $this->user_posts_count && ! current_user_can( $post_type_object->cap->edit_others_posts ) && empty( $_REQUEST['post_status'] ) && empty( $_REQUEST['all_posts'] ) && empty( $_REQUEST['author'] ) && empty( $_REQUEST['show_sticky'] ) ) { … … 261 264 $status_links = array(); 262 265 $num_posts = wp_count_posts( $post_type, 'readable' ); 266 $total_posts = array_sum( (array) $num_posts ); 263 267 $class = ''; 264 268 … … 267 271 $mine = ''; 268 272 269 if ( $this->user_posts_count ) {273 if ( $this->user_posts_count && $this->user_posts_count !== $total_posts ) { 270 274 if ( isset( $_GET['author'] ) && ( $_GET['author'] == $current_user_id ) ) { 271 275 $class = 'current'; … … 292 296 $class = ''; 293 297 } 294 295 $total_posts = array_sum( (array) $num_posts );296 298 297 299 // Subtract post types that are not included in the admin all list.
Note: See TracChangeset
for help on using the changeset viewer.