#21571 closed enhancement (duplicate)
Add support multiple comment types in get_comments
Reported by: | borkweb | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.8.1 |
Component: | Comments | Keywords: | has-patch |
Focuses: | Cc: |
Description
Custom comment types are a nice way to categorize comments, however, if you wish to retrieve multiple comment types you cannot use get_comments. This enhancement request (patch attached) adds support for multiple comment types a la:
$comments = get_comments( array( 'post_id' => $post->ID, 'type' => array( 'a-sweet-comment-type', 'some-other-comment-type', ), ));
Attachments (1)
Change History (10)
#2
@
12 years ago
+1 I have a couple of use cases this would be very helpful for, e.g. displaying a custom comment type in a loop with regular comments, without doing multiple comment queries and then merging the resulting data. This is particularly important because I have more comment types than I want to display, so displaying all the types would not work.
#6
@
10 years ago
I'd like to weigh and add my vote for this enhancement. I'm currently working on a plugin that uses custom comment types and this would definitely make querying multiple types in a single request a lot easier.
Also, I think it makes a lot of sense, because then it would reflect the logic in WP_Query which allows querying posts using an array of post types.
#9
@
10 years ago
- Milestone Future Release deleted
- Resolution set to duplicate
- Status changed from reviewing to closed
Duplicate of #12668.
borkweb, thanks for the patch. As of [30096], the 'type' parameter accepts an array of types. We also now have a 'typein' param.
Patch for adding multiple comment_type support