Make WordPress Core


Ignore:
Timestamp:
02/18/2010 08:01:10 PM (14 years ago)
Author:
ryan
Message:

Don't include internal post types in the total. see #9674

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r13192 r13198  
    14261426    $count = $wpdb->get_results( $wpdb->prepare( $query, $type ), ARRAY_A );
    14271427
    1428     $stats = array( 'publish' => 0, 'private' => 0, 'draft' => 0, 'pending' => 0, 'future' => 0, 'trash' => 0 );
    1429     foreach( (array) $count as $row_num => $row ) {
     1428    $stats = array_fill_keys( get_post_stati(), 0);
     1429    foreach ( (array) $count as $row_num => $row )
    14301430        $stats[$row['post_status']] = $row['num_posts'];
    1431     }
    14321431
    14331432    $stats = (object) $stats;
Note: See TracChangeset for help on using the changeset viewer.