[wp-trac] [WordPress Trac] #16430: Comment 'Reply' button still present when comment max depth has been reached, just without text.
WordPress Trac
wp-trac at lists.automattic.com
Mon Jan 31 22:12:56 UTC 2011
#16430: Comment 'Reply' button still present when comment max depth has been
reached, just without text.
--------------------------+-----------------------------
Reporter: TheGremlyn | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version: 3.0.4
Severity: normal | Keywords: has-patch
--------------------------+-----------------------------
With comment max depth set, in my case, to 5 on the admin panel, the div
for the reply link would still appear even though the text that says
'Reply' would not. Basically, it was an empty div with class="reply". The
fix is quite easy, which I implemented in test on one of my WP sites.
Around line 1372 of wp-includes/comment-template.php, there is the
following is code:
{{{
<div class="reply">
<?php comment_reply_link(array_merge( $args, array('add_below' =>
$add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</div>
}}}
This can simply be enhanced to this:
{{{
<?php if ( $depth < $args['max_depth'] ) : ?>
<div class="reply">
<?php comment_reply_link(array_merge( $args, array('add_below' =>
$add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</div>
<?php endif; ?>
}}}
I just added a quick check to make sure our current comment depth did not
meet (or somehow exceed?) our set max depth.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16430>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list