WordPress File wp-includes/post.php

wp_count_posts()

Count number of posts of a post type and if user has permissions to view.