Ticket #19609: 19609.patch
| File 19609.patch, 1.6 KB (added by linuxologos, 17 months ago) |
|---|
-
wp-admin/includes/class-wp-posts-list-table.php
51 51 $post_type = get_current_screen()->post_type; 52 52 $post_type_object = get_post_type_object( $post_type ); 53 53 54 if ( !current_user_can( $post_type_object->cap->edit_others_posts ) ) { 55 $this->user_posts_count = $wpdb->get_var( $wpdb->prepare( " 56 SELECT COUNT( 1 ) FROM $wpdb->posts 57 WHERE post_type = %s AND post_status NOT IN ( 'trash', 'auto-draft' ) 58 AND post_author = %d 59 ", $post_type, get_current_user_id() ) ); 54 $this->user_posts_count = $wpdb->get_var( $wpdb->prepare( " 55 SELECT COUNT( 1 ) FROM $wpdb->posts 56 WHERE post_type = %s AND post_status NOT IN ( 'trash', 'auto-draft' ) 57 AND post_author = %d 58 ", $post_type, get_current_user_id() ) ); 60 59 61 if ( $this->user_posts_count && empty( $_REQUEST['post_status'] ) && empty( $_REQUEST['all_posts'] ) && empty( $_REQUEST['author'] ) && empty( $_REQUEST['show_sticky'] ) ) 62 $_GET['author'] = get_current_user_id(); 63 } 60 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'] ) ) 61 $_GET['author'] = get_current_user_id(); 64 62 65 63 if ( 'post' == $post_type && $sticky_posts = get_option( 'sticky_posts' ) ) { 66 64 $sticky_posts = implode( ', ', array_map( 'absint', (array) $sticky_posts ) );
