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

git-svn-id: https://develop.svn.wordpress.org/trunk@13198 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2010-02-18 20:01:10 +00:00
parent 15f2f0bda1
commit f17505ed9f
2 changed files with 8 additions and 4 deletions

View File

@@ -228,7 +228,12 @@ if ( $user_posts ) {
$allposts = '&all_posts=1';
}
$total_posts = array_sum( (array) $num_posts ) - $num_posts->trash;
$total_posts = array_sum( (array) $num_posts );
// Subtract post types that are not included in the admin all list.
foreach ( get_post_stati( array('show_in_admin_all_list' => false) ) as $state )
$total_posts -= $num_posts->$state;
$class = empty($class) && empty($_GET['post_status']) ? ' class="current"' : '';
$status_links[] = "<li><a href='edit.php?post_type=$post_type{$allposts}'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ) . '</a>';