[wp-trac] [WordPress Trac] #34442: How to target only the get_comments() query in comment_template()

WordPress Trac noreply at wordpress.org
Mon Jan 11 02:32:20 UTC 2016


#34442: How to target only the get_comments() query in comment_template()
-------------------------+---------------------------
 Reporter:  birgire      |       Owner:  boonebgorges
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:  4.5
Component:  Comments     |     Version:  4.3.1
 Severity:  normal       |  Resolution:  fixed
 Keywords:               |     Focuses:
-------------------------+---------------------------

Comment (by boonebgorges):

 @birgire Thanks for the additional thoughts. `$post` and `$user_ID` are
 already available as globals, and passing them here is likely to cause by-
 reference confusion. `$commenter` is available using
 `wp_get_current_commenter()`, should one want it in the callback. I think
 we should not pass them to the filter, as it'll provide more noise than
 benefit.

 I suppose passing `$file` and `$separate_comments` is relatively harmless,
 but perhaps you can share you thoughts on what the purpose would be? The
 filter we've added is on the arguments passed to `WP_Comment_Query` - that
 is, which comments to display - while `$file` and `$separate_comments`
 both have to do with *how* the comments are displayed. Of what use would
 these values be in a callback?

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


More information about the wp-trac mailing list