[wp-trac] [WordPress Trac] #38170: get_comment_reply_link(): access to args field 'max_depth' even if not set?

WordPress Trac noreply at wordpress.org
Wed Sep 28 08:47:13 UTC 2016


#38170: get_comment_reply_link(): access to args field 'max_depth' even if not set?
--------------------------+---------------------------
 Reporter:  d4z_c0nf      |       Owner:  boonebgorges
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  4.7
Component:  Comments      |     Version:  4.6.1
 Severity:  normal        |  Resolution:  fixed
 Keywords:                |     Focuses:
--------------------------+---------------------------

Comment (by d4z_c0nf):

 Thanks @boonebgorges
 yeah the comment walker passes the max_depth param to it (wp_list_comment
 arg).

 To be totally honest, I'm not sure how much "optional" the
 `get_comment_reply_link()` $args parameter is.
 With the default values (depth==max-depth==0) that function will just
 silently exit.

 What I mean is that the function doesn't retrieve those params by itself
 so in order to have some kind of result those params must be passed (depth
 can be retrieved from the $GLOBALS - set by the walker, max_depth is
 options dependent and is set in `wp_list_comments()` ).

 IMHO the doc should be improved mentioning that if you call the
 function(s) without specify those params, in custom walkers or
 `wp_list_comments` callback contexts, you'll get nothing :D

 But maybe that's a totally different story.

 Thanks again.

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


More information about the wp-trac mailing list