This will do what you want:
$args = array(
'author' => $curauth->ID,
'post_status' => array(
'publish',
'pending',
'draft',
'future'
)
);
$posts = new WP_Query();
$post_count = $posts->found_posts;
It will include drafts, pending posts, published posts, and future posts. There are more you can set, such as trashed posts, and private posts, but that didn’t seem to follow the intent of the question. This method will include custom post types as well as the builtin post types, so additional filtering may be in order.
Docs: WP_Query
Related Posts:
- Is it possible to have more “levels” of draft/published statuses?
- What is a “protected” post status?
- how to assign a status/mark to post?
- Why doesn’t wp_update_post() update the post_status field?
- register_post_status and show_in_admin_all_list
- Changing post status in one click
- How can I run custom function when post status is changed?
- WP_Post_List_Table::get_views – Have post counts account for filters?
- Creating/editing custom ‘post-state’
- Using arbitrary post status without registering it
- Get a list of ALL Statuses both registered and built-in
- Adding custom post status to visibility in publish meta box
- Changing post status
- Change scheduled posts to published
- Remove ‘private’ and ‘pending review’ options from post status dropdown
- Can not get future_to_publish to work
- Which is the better way to get the status of a post?
- “Publish immediately” with custom post status
- Modify Post Status Arguments
- Additional page and post status types
- Add a simple JS Alert Box on Post Submission
- Function to change post status IF current user and post author are the same
- Schedule future post to custom post status instead of publish?
- Why does get_post_status display published when attachment is in trash?
- Force Custom Post Type Status to ‘Future’ on first Save or Publish
- Workflow for attachments in WordPress
- how to transition to custom post status on post save
- How to change custom post type status when non-admin updates post?
- Custom post status filter links always show a count of all posts in the site with that status, not the logged in users count
- wordpress post status inquery
- Multiple Post Status
- retrieve post details in loop
- Any way to change post/page status when editing page?
- How to change post status from “draft” to “publish”?
- transition_post_status doesn’t work with bulk updates
- Submitted for Review back to a Draft page
- How to Add Custom Post Status in WordPress Admin
- Auto draft posts when scheduled date is reached
- Changing a post status name
- How to update post status to draft if user role is “pending’
- How to create posts with a specific date in bulk
- How to Display a List of Users Who Have Made at Least 1 Post?
- Turn Off Automatic Trash Deletion?
- Let private posts stay in status “private” after edit through “editors”
- How to check if page has status published
- Custom post status and preview
- get_terms(); show private posts when logged in
- featuring old articles without messing up with the archive
- Show scheduled posts in archive page
- Enable commenting on front-end preview page for pending posts
- Error after deleting Custom Post Type with a function (no trash used)
- Problem duplicated shortlinks bitly
- How do I batch create revisions of all posts?
- ‘transition_post_status’ only fires when pressing “Add New”
- wp_transition_post_status does not change the status of the post
- stop login if user_status equal zero
- Add Post Status to Body Class
- Automatically remove a canceled order in Woocommerce
- Add new post with predefined / preset date
- Template redirect template loaded, but the header 404
- All, published and pending order
- Custom date changer post_date => future – missed schedule error
- How to change post status from frontend?
- Featured image overlay when changing post status
- Second transition_post_status hook fired instead of the first
- Add custom post type drafts to RSS feed
- How to define which register_post_status goes to which register_post_type?
- Get publish post link?
- Show user info in a hovercard [closed]
- Do action for only switch status for publish_post
- Ajax function on #publish only saves as draft – how to make it publish?
- Accessing private posts through REST API, same code that works in remote doesn’t in local
- Remove Save Draft & Preview Buttions.. and also Statius: Draft & Visibility: Public
- wp_dropdown_pages : choose post status to list in dropdown
- Restrict access to a post once it is tagged as a given status
- What function publishes a post when you click the publish button?
- WP_Query will not display draft posts
- How can I restore posts from ‘trash’ with their previous post_status? – WordPress
- Set Post Private if no linked Post Objects (ACF)
- Updating post status via rest api
- How to hide private posts even if user is admin
- edit.php all post not working
- If click on Save/Publish change Post Status to Pending Review instead Publish
- Bulk edit orders to ‘wc-processing’ status
- Custom Post Status not getting displayed after post update
- Send default WooCommerce email when switching from custom order status
- How to save post_status using action save_post?
- How to stop post status from reverting to Published?
- Why transition_post_type hook is called twice for the same post?
- Modify loop to include all post statuses not just ‘published’
- Implement post status update as frontend news announcement
- Custom Post Status & Taxonomies
- How to filter posts in admin by before date or by post status ‘future’?
- Get new (not old) post inside transition_post_status hook
- Excluding certain post status’s from pagination
- Enforce conditions only for draft posts using WyPiekacz, ignore pending and published posts
- get_posts includes “auto drafts”?
- Post Format Status [closed]
- Change a Post’s Status based on the date from a custom field? (for Event posts)
- Give attachments an archive page, and exclude unattached ones