Changeset 34360
- Timestamp:
- 09/20/2015 05:27:35 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-posts-list-table.php
r34331 r34360 78 78 ) ); 79 79 80 $post_type = $this->screen->post_type;80 $post_type = $this->screen->post_type; 81 81 $post_type_object = get_post_type_object( $post_type ); 82 83 if ( !current_user_can( $post_type_object->cap->edit_others_posts ) ) { 84 $exclude_states = get_post_stati( array( 'show_in_admin_all_list' => false ) ); 85 $this->user_posts_count = $wpdb->get_var( $wpdb->prepare( " 86 SELECT COUNT( 1 ) FROM $wpdb->posts 87 WHERE post_type = %s AND post_status NOT IN ( '" . implode( "','", $exclude_states ) . "' ) 88 AND post_author = %d 89 ", $post_type, get_current_user_id() ) ); 90 91 if ( $this->user_posts_count && empty( $_REQUEST['post_status'] ) && empty( $_REQUEST['all_posts'] ) && empty( $_REQUEST['author'] ) && empty( $_REQUEST['show_sticky'] ) ) 92 $_GET['author'] = get_current_user_id(); 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() ) ); 92 93 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'] ) ) { 94 $_GET['author'] = get_current_user_id(); 93 95 } 94 96 … … 263 265 $current_user_id = get_current_user_id(); 264 266 $all_args = array( 'post_type' => $post_type ); 267 $mine = ''; 265 268 266 269 if ( $this->user_posts_count ) { … … 284 287 ); 285 288 286 $ status_links['mine']= $this->get_edit_link( $mine_args, $mine_inner_html, $class );289 $mine = $this->get_edit_link( $mine_args, $mine_inner_html, $class ); 287 290 288 291 $all_args['all_posts'] = 1; … … 311 314 312 315 $status_links['all'] = $this->get_edit_link( $all_args, $all_inner_html, $class ); 316 if ( $mine ) { 317 $status_links['mine'] = $mine; 318 } 313 319 314 320 foreach ( get_post_stati(array('show_in_admin_status_list' => true), 'objects') as $status ) {
Note: See TracChangeset
for help on using the changeset viewer.