[wp-trac] [WordPress Trac] #40073: WP_Comment_Query should support a comment type of "comment"

WordPress Trac noreply at wordpress.org
Sun Mar 12 18:53:53 UTC 2017


#40073: WP_Comment_Query should support a comment type of "comment"
-------------------------+-----------------------------
 Reporter:  rogerlos     |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  Comments     |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+-----------------------------
Changes (by boonebgorges):

 * milestone:  Awaiting Review => Future Release


Comment:

 @rogerlos Thanks very much for the clear and sensible ticket.

 I agree that the current situation is not ideal. If we're going to allow
 `comment_type` to be set to 'comment', then we need to be able to allow
 these comments to be queried by type as well. As you indicate, this is a
 problem not only for 'comment', but for 'pings' and 'all' as well.

 Comment query type handling is already too "magic" for my taste. The fact
 that 'comment' fetches '' and 'pings' fetches 'pingback'/'trackback' is
 confusing, and is there only for legacy reasons. Let's not make things
 worse by trying to lump more into these clauses, as in your first
 suggestion.

 I think I like the idea of combining a few of your suggestions:
 - Introduce a new parameter (like your suggested `ignore_default_types`,
 but maybe we can come up with a better name, since it's less about
 "ignoring"  than about translating reserved kewords) that causes `type` to
 be interpreted literally.
 - Update the `wp_insert_comment()` and `wp_update_comment()` documentation
 to strongly discourage the use of comment type 'comment', 'pings', 'all'.

 I don't think we can actually *prevent* the use of these comment types,
 for backward-compatibility reasons. I can imagine that there are many
 cases like yours where developers are passing 'comment' and expecting it
 to be recorded in the database.

 I'd like a second opinion from @rachelbaker about this.

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


More information about the wp-trac mailing list