Add depth handling to comment_reply_link(). see #7635

git-svn-id: https://develop.svn.wordpress.org/trunk@8878 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-09-12 23:45:15 +00:00
parent 0acc8c3900
commit 61400609c9
1 changed files with 4 additions and 2 deletions

View File

@ -845,10 +845,12 @@ function comment_reply_link($args = array(), $comment = null, $post = null) {
global $user_ID;
$defaults = array('add_below' => 'comment', 'respond_id' => 'respond', 'reply_text' => __('Reply'),
'login_text' => __('Log in to Reply'));
'login_text' => __('Log in to Reply'), 'depth' => 0);
$args = wp_parse_args($args, $defaults);
if ( 0 == $args['depth'] || $args['max_depth'] < $args['depth'] )
extract($args, EXTR_SKIP);
$comment = get_comment($comment);
@ -939,7 +941,7 @@ class Walker_Comment extends Walker {
<?php echo apply_filters('comment_text', get_comment_text()) ?>
<div class='reply'>
<?php if ( 0 == $args['depth'] || $depth < $args['depth'] ) echo comment_reply_link(array('add_below' => 'div-comment')) ?>
<?php echo comment_reply_link(array('add_below' => 'div-comment', 'depth' => $args['depth'], 'max_depth' => $depth)) ?>
<?php if ( 'list' == $args['style'] ) : ?>
</div>
<?php endif; ?>