WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/03/2013 01:15:30 AM (6 years ago)
Author:
nacin
Message:

Avoid counting auto-drafts in sticky.

props nofearinc.
fixes #25127.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r25676 r25678  
    7171        if ( 'post' == $post_type && $sticky_posts = get_option( 'sticky_posts' ) ) {
    7272            $sticky_posts = implode( ', ', array_map( 'absint', (array) $sticky_posts ) );
    73             $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 ) );
     73            $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 ) );
    7474        }
    7575    }
Note: See TracChangeset for help on using the changeset viewer.