#21364 closed enhancement (fixed)
Pass post type to count_user_posts()
Reported by: | Caspie | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Posts, Post Types | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
Add $post_type argument to count_user_posts(). Defaults to 'post', as it is hard-coded now.
Attachments (3)
Change History (18)
#6
@
10 years ago
- Keywords needs-refresh removed
get-user-post-count-post-type.21364.diff
adds an argument for the post type for both count_user_posts
and get_the_author_posts
.
#7
@
10 years ago
- Keywords needs-testing removed
Hi,
I've just tested this patch - works as intended.
#9
@
10 years ago
- Keywords has-unit-tests added; needs-unit-tests removed
21364.diff adds a unit test. I also removed the changes to get_the_author_posts()
as that falls out of the scope of this ticket.
#10
follow-up:
↓ 12
@
10 years ago
Hi Guys
Should allow an array of post type to get passed in?
Paul
#11
@
10 years ago
- Milestone changed from Awaiting Review to 4.1
- Owner set to boonebgorges
- Status changed from new to accepted
#12
in reply to:
↑ 10
@
10 years ago
Replying to pbearne:
Hi Guys
Should allow an array of post type to get passed in?
Paul
This is not a bad idea, but it's going to need modifications to the current patch that are non-trivial. I'd suggest that we go with what we've currently got for 4.1, and you should feel free to open another ticket if you'd like support for multiple post types.
If we're doing that, should it be passed to the filter as well?