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
- Let private posts stay in status “private” after edit through “editors”
- Custom post type by ID in root folder
- Custom query filter not working on woocommerce category page
- How to change post status in hook?
- Search pre_get_posts filter which can handle multiple post types and categories?
- Limiting number of custom posts shown on taxonomy page
- How do I limit the status options for bulk/quick edit to only Published and Draft?
- Include custom post type in “all posts”
- Trying to exclude first 5 posts from the first page on the homepage
- pre_get_posts Remove posts based on meta value with ‘post__not_in’
- Show recent published posts
- How to create an archive for all posts that do not have a post format?
- Check whether a custom taxonomy term has published posts?
- Custom Order in WP Query
- How to Modify Taxonomy Archive Page with Search Parameter?
- How to add custom taxonomy to search
- Problem duplicated shortlinks bitly
- How do I batch create revisions of all posts?
- Remove category from query (show all posts in archive.php) pre_get_posts()
- Add new post with predefined / preset date
- Template redirect template loaded, but the header 404
- Sort the result of the main Query in shop page by a custom taxonomy
- How to exclude latest x posts from a paginated query?
- Second transition_post_status hook fired instead of the first
- Use custom post meta in permalink
- Custom Taxonomy Not Working When added to WordPress Search
- Help ordering Post loop by two meta values
- How to define which register_post_status goes to which register_post_type?
- Ajax function on #publish only saves as draft – how to make it publish?
- $query->is_main_query() is causing query’s tax_query to be ignored
- How can I completely hide a taxonomy term from “frontend”? [closed]
- Modify date query by URL parameter using pre_get_posts and $_GET
- Child pages not affected by orderby
- Why query by specific date with variables doesn’t return same result that with harcoded integers?
- How can I restore posts from ‘trash’ with their previous post_status? – WordPress
- Order posts by taxonomy terms
- unable to customize query to get filtered products by meta_key
- Order column custom date using pre_get_posts
- Random order not working correctly when using default loop + $query->set
- Setting user permissions per post
- How to stop post status from reverting to Published?
- CPT year wise archive based on custom date Field
- Modify loop to include all post statuses not just ‘published’
- WP search in metadata post
- Custom Post Status & Taxonomies
- pre_get_posts with multiple post types AND a meta_key
- Fetch post meta in the same query as the main loop
- Filter WP_Query output before it is accessed (pre_get_posts)?
- Problem to show custom post type in archive page category wise
- Enforce conditions only for draft posts using WyPiekacz, ignore pending and published posts
- How to pass >= condition filter to my year custom tax_query
- hide woo commerce dashboard status and reports from woo commerce from specific users but display to other users
- Admin Post List table Query filtering “WHERE” for custom post type
- Change Post status based on custom field date +1 day