[wp-trac] [WordPress Trac] #19966: Comment in the 1 level depth makes comment_reply_link() produce nothing
WordPress Trac
wp-trac at lists.automattic.com
Sat Feb 4 07:04:30 UTC 2012
#19966: Comment in the 1 level depth makes comment_reply_link() produce nothing
--------------------------+---------------------------------------------
Reporter: egorpromo | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version: 3.3.1
Severity: normal | Keywords: needs-testing reporter-feedback
--------------------------+---------------------------------------------
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)
{
$args=array(
'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 [http://core.trac.wordpress.org/browser/tags/3.1.1/wp-includes
/comment-template.php#L1044] 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'] )
return;
}}}
Because that my comment_reply_link() function produces nothing when
wordpress ouputs comments of first level depth
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19966>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list