WordPress File wp-includes/post.php

wp_count_posts

Modify returned post counts by status for the current post type.