Opened 15 years ago
Last modified 5 years ago
#12960 new enhancement
Number of posts on the Users page should include drafts and pending review
Reported by: | archon810 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.9.2 |
Component: | Users | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
The numbers of posts on the Users page currently only include published posts, which I think is not good enough. For example, I have a contributor who has only written a few drafts and submitted a few articles for review.
If I decide to delete him and base my decision on what I see on the Users page, I would probably just go with the "Delete the user and all his posts" option, which would delete more than I would expect.
Attachments (4)
Change History (14)
#8
@
8 years ago
- Keywords needs-testing added; needs-refresh removed
Refreshed the patch with current trunk in 12960.2.diff
This needs to be tested as the function get_posts_by_author_sql
is also used in WP_User_Query->parse_orderby()
#10
@
5 years ago
Thanks for the ticket @archon810. Yeah it's 10 years old now! Hopefully this could gain traction soon.
While @Nikschavan patch works (thanks for the patch!), I don't think directly changing the SQL inside get_posts_by_author_sql()
is the best approach since it could lead to unwanted changes to any plugins / themes that uses the function.
In my latest patch, 12960.3.diff, I introduced a new parameter $include_unpublished
which if set to true
would add the SQL that will include pending
, future
, and draft
posts.
Indeed, scheduled, pending and draft posts should be counted as well