Make WordPress Core

Ticket #12692: 12692.diff

File 12692.diff, 1.6 KB (added by rovo89, 15 years ago)
  • wp-admin/edit.php

     
    143143
    144144$user_posts = false;
    145145if ( !current_user_can($post_type_object->edit_others_cap) ) {
    146         $user_posts_count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(1) FROM $wpdb->posts WHERE post_type = '%s' AND post_status != 'trash' AND post_author = %d", $post_type, $current_user->ID) );
     146        $user_posts_count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(1) FROM $wpdb->posts WHERE post_type = '%s' AND post_status != 'trash' AND post_status != 'auto-draft' AND post_author = %d", $post_type, $current_user->ID) );
    147147        $user_posts = true;
    148148        if ( $user_posts_count && empty($_GET['post_status']) && empty($_GET['all_posts']) && empty($_GET['author']) )
    149149                $_GET['author'] = $current_user->ID;
     
    226226if ( $user_posts ) {
    227227        if ( isset( $_GET['author'] ) && ( $_GET['author'] == $current_user->ID ) )
    228228                $class = ' class="current"';
    229         $status_links[] = "<li><a href='edit.php?author=$current_user->ID'$class>" . sprintf( _nx( 'Mine <span class="count">(%s)</span>', 'Mine <span class="count">(%s)</span>', $user_posts_count, 'posts' ), number_format_i18n( $user_posts_count ) ) . '</a>';
     229        $status_links[] = "<li><a href='edit.php?post_type=$post_type&author=$current_user->ID'$class>" . sprintf( _nx( 'Mine <span class="count">(%s)</span>', 'Mine <span class="count">(%s)</span>', $user_posts_count, 'posts' ), number_format_i18n( $user_posts_count ) ) . '</a>';
    230230        $allposts = '&all_posts=1';
    231231}
    232232