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
- How can I make a custom post status private or draft?
- Changing Post Status from Pending to Publish twice daily
- When to use WP_query(), query_posts() and pre_get_posts
- How to Get All Posts with any post status?
- Sort on meta value but include posts that don’t have one
- Can I exclude a post by meta key using pre_get_posts function?
- Should I use Pre Get Posts or WP_Query
- Using pre_get_posts with WP_Query
- Sticky Posts exceed posts per page limit
- How to check if a user (not current user) is logged in?
- Using pre_get_posts on true pages and static front pages
- Theres a way to use $query->set(‘tax_query’ in pre_get_posts filter?
- Modify Taxonomy pages to exclude items in child taxonomies
- New post status for custom post type
- How to update page status from publish to draft and draft to publish
- WP_Query orderby post__in remains ineffective in the Loop [closed]
- How to Change Order of Posts in Admin?
- Media library to list images only user uploaded
- How to Display a List of Users Who Have Made at Least 1 Post?
- multiple orderby in pre_get_posts action
- What is “main query”? [duplicate]
- Turn Off Automatic Trash Deletion?
- Prevent pre_get_posts filter on specific post type
- wordpress function to change post status [duplicate]
- Obliterate the main query and replace it
- Using pre_get_posts to rewrite search query to display posts from multiple taxonomies
- Using get_post_meta with new_to_publish
- Post injection – how to exclude the original post
- sort child pages on admin
- Custom Table Column Sortable by Taxonomy Query
- Include and Exclude Taxonomies From Archives & Feeds Using ‘pre_get_posts’
- Custom search filter causes menu and query_posts problems
- Custom column for changing post status via ajax
- Using meta_query on pre_get_posts to exclude a particular meta_key value
- How to change “Draft” string for status of custom post type to “Unavailable”?
- Reduce or prevent calling of update_meta_cache
- How to add taxonomy filter on the query fly?
- How to display the status of users (online – offline) in archive.php
- Let private posts stay in status “private” after edit through “editors”
- How to check if page has status published
- Adding meta_key via pre_get_posts causes navigation to disappear
- How to 301 private posts rather than 404?
- is_category() in pre_get_posts strange error
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- $query->set in pre_get_posts is unintentionally affecting the backend
- pre_get_posts with tax_query causes empty result
- WP_Query by post ID doesn’t work if post is in custom post_status
- How to uniquely identify queries?
- Show only posts which can be commented OR have custom meta field
- Order Search Results Page by meta_value If no Value Return Remaining Results
- complex restriction of items in media library
- Using pre_get_posts to set posts per page, how do I?
- How to put custom post types on front page
- Archive Listings Filtered by Date Values in a Custom Field/Post Meta?