Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#19966 closed defect (bug) (invalid)

Comment in the 1 level depth makes comment_reply_link() produce nothing

Reported by: egorpromo's profile egorpromo Owned by: egorpromo's profile egorpromo
Milestone: Priority: normal
Severity: normal Version: 3.3.1
Component: Comments Keywords: close
Focuses: Cc:


I use Walker_Comment class to create my comment list.

class indysiteru_walker_comment extends Walker_Comment
	function start_lvl(&$output, $depth, $args)

	function end_lvl(&$output, $depth, $args)


	function start_el(&$output, $comment, $depth, $args)

'depth' => $depth,
'max_depth' => $args['max_depth'],
'reply_text' => 'reply',
'login_text' => 'login to reply' );
comment_reply_link( $args );


	function end_el(&$output, $comment, $depth, $args)


Parameter $depth is 0 (zero int) when first comment is output. So as you can see and definition of get_comment_reply_link() within it there is zero check in 1044 line

if ( 0 == $args['depth'] || $args['max_depth'] <= $args['depth'] )

Because that my comment_reply_link() function produces nothing when wordpress ouputs comments of first level depth

Change History (4)

#1 @egorpromo
12 years ago

  • Owner set to egorpromo
  • Status changed from new to accepted

#2 @qdinar
12 years ago

this my comment here was wrong: "i wanted to report a bug and found this. i wanted to say if i move comment form with js, i cannot move it [back] to main level. (can move only under other comments, but not under post). ( comment-reply.js is used to move form )"

it is possible with "cancel" button.

Last edited 12 years ago by qdinar (previous) (diff)

#3 @solarissmoke
12 years ago

  • Keywords close added; needs-testing reporter-feedback removed

That's how it's supposed to be. The depth should be set to 1 for top-level comments. In the Comment_Walker class the depth argument is bumped at the beginning of each loop - you should be doing the same in your custom class.

#4 @SergeyBiryukov
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.