Avoid counting auto-drafts in sticky.

props nofearinc.
fixes #25127.

Built from https://develop.svn.wordpress.org/trunk@25678


git-svn-id: http://core.svn.wordpress.org/trunk@25594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-10-03 01:16:10 +00:00
parent b6d680174d
commit 4c63d45139

View File

@ -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 ) );
}
}