You might want to remove those counts and replace them with your own.
function insert_post_counts($views){
//Run your query to count posts
//use wp_cache_set and wp_cache_get to optimize performance
$edit_url = admin_url( 'edit.php' );
$views['all'] = 'All <a href="'.$edit_url.'">('.$all_count.')</a>';
$views['publish'] = 'Published <a href="'.$edit_url.'?post_status=publish">('.$publish_count.')</a>';
$views['draft'] = 'Draft <a href="'.$edit_url.'?post_status=draft">('.$draft_count.')</a>';
$views['trash'] = 'Trash <a href="'.$edit_url.'?post_status=trash">('.$draft_count.')</a>';
return $views;
}
add_filter('views_edit-post, 'insert_post_counts', 10, 1);
You can reference how wp_count_posts works to generate the native post counts.
Hope this helps!
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?
- 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
- Getting the different post statuses + count like in edit.php, in a custom submenu page
- Include Drafts or Future posts with count_user_posts?
- How to display future posts – modified query still yields 404
- 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?
- Show scheduled posts in main loop but not in WP_Query?
- 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
- How to hide private posts even if user is admin
- Auto draft posts when scheduled date is reached
- Include attachments with a custom taxonomy in search
- 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
- Sticky Posts exceed posts per page limit
- How to Change Order of Posts in Admin?
- Media library to list images only user uploaded
- Using meta_query on pre_get_posts to exclude a particular meta_key value
- “pre_get_posts” firing on every query
- Using is_main_query to select custom post type on certain page
- Add custom field (value) to search result (without plugin)
- Insert/sticky specific post into Loop at specific location
- Sort custom-posts in archive.php via meta-key?
- How to Get All Posts but the Private ones?
- Detect type of post status transition
- change a post status when users update posts?
- WordPress custom search form with pre_get_posts not work
- Custom post type with tags
- update_post_meta() not working when used with WordPress action
- Filter query posts by the count of metas for a meta key
- pre get posts changing the query
- order by multiple meta keys in pre_get_posts
- Using pre_get_posts on a specific core/query block
- add filter to “quick edit menu” in wordpress admin
- Is it possible to change an existing post status from ‘pending’ to ‘publish’ via email?
- how to remove dash (-) post status from post title on posts listing page wordpress
- Wp_query Add specific pending posts
- Make blog page show 10 on first page, 9 on every other page
- Alter query using pre_get_posts() if meta_key is present
- Filtering out child category posts from parent category archive not working
- pre_get_posts and set
- Woocommerce – exclude only older out-of-stock items
- How I can change the condition or compare operator for WP_Query in pre_get_posts
- get_comments with post_status ‘public’ retrieves NULL result
- get_posts() interrupt because of filter
- How do I modify this wpdb query to include posts that have a post_status of publish and draft?
- Show Last Revision Of Post That Has A Published Status On Single Page
- Exclude post with taxonomy and from the terms (taxonomy & tag) posts count
- How to use pre_get_posts on archive page custom post type
- Main query disturb pre_get_post by category query
- Order resultset by configured value and then list all the rest
- Show custom post status when logged out
- WordPress meta query not working
- How publish post from pending status
- Why does this incorrect pre_get_posts meta_query work for sort order?
- Limit default Search query to post_title
- Conditional tags returning different results for different areas on a page?
- Pre_get_posts comparison with custom field doesn’t work
- meta field search too restrictive in pre_get_post() for custom search
- In the Edit Post page how do I modify with jQuery the status select list?
- How to order posts by parents?
- How to var dump urls for all posts
- How to change post status to draft in Gutenberg?
- Search query alteration not working for meta values
- Sorting a custom post type in pre_get_posts
- 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
- How can I incldue a “private” post type in a loop for public users?