WordPress.org

Make WordPress Core

Opened 20 months ago

Last modified 6 weeks ago

#21571 new enhancement

Add support multiple comment types in get_comments

Reported by: borkweb Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.8.1
Component: Comments Keywords: has-patch 4.0-early
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)

comment.diff (588 bytes) - added by borkweb 20 months ago.
Patch for adding multiple comment_type support

Download all attachments as: .zip

Change History (5)

borkweb20 months ago

Patch for adding multiple comment_type support

comment:2 vhauri20 months 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.

Last edited 20 months ago by vhauri (previous) (diff)

comment:3 borkweb6 weeks ago

  • Keywords has-patch added
  • Version set to 3.8.1

comment:4 SergeyBiryukov6 weeks ago

  • Keywords 4.0-early added
  • Milestone changed from Awaiting Review to Future Release
Note: See TracTickets for help on using tickets.