{"id":878,"date":"2012-10-09T13:53:49","date_gmt":"2012-10-09T23:53:49","guid":{"rendered":"http:\/\/mymonkeydo.com\/?p=878"},"modified":"2012-10-09T13:53:49","modified_gmt":"2012-10-09T23:53:49","slug":"wordpress-change-post-counts-on-edit-php","status":"publish","type":"post","link":"https:\/\/mymonkeydo.com\/wordpress-change-post-counts-on-edit-php\/","title":{"rendered":"WordPress – Change Post Counts on edit.php"},"content":{"rendered":"
I wanted to change what posts were displayed to a user when they logged into wordpress and view the Posts page \u00a0I could easily alter what posts are shown by using the ‘pre_get_posts’ filter, but the problem was that the number of posts for each status did not change. \u00a0You know, at the top of the page it looks like: “All (5) | Published (5)”. \u00a0The number 5 did not reflect the number of posts being shown.<\/p>\n
I was hoping to find a filter of some sort on the\u00a0wp_count_posts function, but there are none. \u00a0The second best solution is to rewrite that whole line using the ‘views_edit-post’ filter where “edit-post” is the page id. \u00a0A sample of what can be done is in the link below.<\/p>\n
<\/p>\n