WordPress.org

Make WordPress Core

Changeset 25676


Ignore:
Timestamp:
10/03/2013 12:59:12 AM (5 years ago)
Author:
nacin
Message:

Post lists table: When counting a user's posts, use get_post_stati() instead of hardcoded internal statuses.

props creativeinfusion.
fixes #24818.

File:
1 edited

Legend:

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

    r25505 r25676  
    5858
    5959        if ( !current_user_can( $post_type_object->cap->edit_others_posts ) ) {
     60            $exclude_states = get_post_stati( array( 'show_in_admin_all_list' => false ) );
    6061            $this->user_posts_count = $wpdb->get_var( $wpdb->prepare( "
    6162                SELECT COUNT( 1 ) FROM $wpdb->posts
    62                 WHERE post_type = %s AND post_status NOT IN ( 'trash', 'auto-draft' )
     63                WHERE post_type = %s AND post_status NOT IN ( '" . implode( "','", $exclude_states ) . "' )
    6364                AND post_author = %d
    6465            ", $post_type, get_current_user_id() ) );
Note: See TracChangeset for help on using the changeset viewer.