From 066c4893a1534ec33917d38b267dac99091d0ca5 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 3 Apr 2010 05:19:39 +0000 Subject: [PATCH] Fix "Mine" posts link on edit.php. Adds post_type to URL, and hides auto-drafts from count. props rovo89, fixes #12692. git-svn-id: https://develop.svn.wordpress.org/trunk@13957 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/edit.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 2f3ec853df..79442a6ec2 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -143,7 +143,7 @@ wp_enqueue_script('inline-edit-post'); $user_posts = false; if ( !current_user_can($post_type_object->edit_others_cap) ) { - $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) ); + $user_posts_count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(1) FROM $wpdb->posts WHERE post_type = '%s' AND post_status NOT IN ('trash', 'auto-draft') AND post_author = %d", $post_type, $current_user->ID) ); $user_posts = true; if ( $user_posts_count && empty($_GET['post_status']) && empty($_GET['all_posts']) && empty($_GET['author']) ) $_GET['author'] = $current_user->ID; @@ -226,7 +226,7 @@ $allposts = ''; if ( $user_posts ) { if ( isset( $_GET['author'] ) && ( $_GET['author'] == $current_user->ID ) ) $class = ' class="current"'; - $status_links[] = "
  • " . sprintf( _nx( 'Mine (%s)', 'Mine (%s)', $user_posts_count, 'posts' ), number_format_i18n( $user_posts_count ) ) . ''; + $status_links[] = "
  • " . sprintf( _nx( 'Mine (%s)', 'Mine (%s)', $user_posts_count, 'posts' ), number_format_i18n( $user_posts_count ) ) . ''; $allposts = '&all_posts=1'; }