[wp-trac] [WordPress Trac] #12668: Better support for custom comment types

WordPress Trac noreply at wordpress.org
Wed Oct 15 03:22:50 UTC 2014


#12668: Better support for custom comment types
----------------------------------------+------------------------------
 Reporter:  ptahdunbar                  |       Owner:  ptahdunbar
     Type:  enhancement                 |      Status:  reopened
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  Comments                    |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+------------------------------

Comment (by mordauk):

 Replying to [comment:62 joshlevinson]:
 > Replying to [comment:61 mordauk]:
 > > [https://core.trac.wordpress.org/attachment/ticket/12668/12668
 -comments-query.patch 12668-comments-query.patch] addresses that issue.
 >
 > I may be wrong, but I don't think that patch (or any so far on this
 ticket) addresses what boonebgorges is discussing. I think boonebgorges is
 questioning the first item of the scope you defined. That is, whether it's
 best to remove all but the default comment types from
 display/administration or to keep them in comment queries and allow—via
 filters—the opposite: explicit ''removal'' of specific types from the
 queries.

 They do. To remove the non-default comments from the list table, two
 things have to be done:

 1. The comment type needs to be set to `array( 'pingback', 'trackback',
 'comment' )` as the default in the `prepare_items()` method of `class-wp-
 comments-list-table.php`.
 [https://core.trac.wordpress.org/attachment/ticket/12668/12668-comments-
 list-table.patch 12668-comments-list-table.patch] addresses this.

 2. `WP_Comment_Query` has to be modified slightly so that it can accept an
 array of comment types.
 [https://core.trac.wordpress.org/attachment/ticket/12668/12668-comments-
 query.patch 12668-comments-query.patch] addresses this.

 If a plugin wants to change the comment types that are included by
 default, all it would need to do is modify the comment query args with
 `pre_get_comments`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/12668#comment:63>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list