#21364 closed enhancement (fixed)
Pass post type to count_user_posts()
| Reported by: | Caspie | Owned by: | boonebgorges |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.1 |
| Component: | Posts, Post Types | Version: | 3.0 |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
Description
Add $post_type argument to count_user_posts(). Defaults to 'post', as it is hard-coded now.
Attachments (3)
Change History (18)
#6
@
12 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
@
12 years ago
- Keywords needs-testing removed
Hi,
I've just tested this patch - works as intended.
#9
@
12 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
@
12 years ago
Hi Guys
Should allow an array of post type to get passed in?
Paul
#12
in reply to: ↑ 10
@
12 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
If we're doing that, should it be passed to the filter as well?