From a2c2641419d968d30e2491c89c14006f5f850620 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 3 Oct 2013 01:15:30 +0000 Subject: [PATCH] Avoid counting auto-drafts in sticky. props nofearinc. fixes #25127. git-svn-id: https://develop.svn.wordpress.org/trunk@25678 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-posts-list-table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php index 79afc47289..cb884e7217 100644 --- a/src/wp-admin/includes/class-wp-posts-list-table.php +++ b/src/wp-admin/includes/class-wp-posts-list-table.php @@ -70,7 +70,7 @@ class WP_Posts_List_Table extends WP_List_Table { if ( 'post' == $post_type && $sticky_posts = get_option( 'sticky_posts' ) ) { $sticky_posts = implode( ', ', array_map( 'absint', (array) $sticky_posts ) ); - $this->sticky_posts_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %s AND post_status != 'trash' AND ID IN ($sticky_posts)", $post_type ) ); + $this->sticky_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 ID IN ($sticky_posts)", $post_type ) ); } }