- Timestamp:
- 09/28/2015 07:14:56 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-posts-list-table.php
r34584 r34667 81 81 $post_type_object = get_post_type_object( $post_type ); 82 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 } 83 $exclude_states = get_post_stati( array( 84 'show_in_admin_all_list' => false, 85 ) ); 86 $this->user_posts_count = intval( $wpdb->get_var( $wpdb->prepare( " 87 SELECT COUNT( 1 ) 88 FROM $wpdb->posts 89 WHERE post_type = %s 90 AND post_status NOT IN ( '" . implode( "','", $exclude_states ) . "' ) 91 AND post_author = %d 92 ", $post_type, get_current_user_id() ) ) ); 95 93 96 94 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'] ) ) { … … 270 268 $all_args = array( 'post_type' => $post_type ); 271 269 $mine = ''; 270 271 // Subtract post types that are not included in the admin all list. 272 foreach ( get_post_stati( array( 'show_in_admin_all_list' => false ) ) as $state ) { 273 $total_posts -= $num_posts->$state; 274 } 272 275 273 276 if ( $this->user_posts_count && $this->user_posts_count !== $total_posts ) { … … 296 299 $class = ''; 297 300 } 298 299 // Subtract post types that are not included in the admin all list.300 foreach ( get_post_stati( array('show_in_admin_all_list' => false) ) as $state )301 $total_posts -= $num_posts->$state;302 301 303 302 if ( empty( $class ) && ( ( $this->is_base_request() && ! $this->user_posts_count ) || isset( $_REQUEST['all_posts'] ) ) ) {
Note: See TracChangeset
for help on using the changeset viewer.