From d0bbb4cc01ca7598ad8f0c74e0d4a1ec76613e9a Mon Sep 17 00:00:00 2001
From: Travis Rothlisberger <t.rothlis@gmail.com>
Date: Wed, 23 Nov 2016 22:30:01 -0800
Subject: [PATCH] Support override of depth constraint on reply link
---
wp-includes/comment-template.php | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php
index c914796..e21fc09 100644
a
|
b
|
function get_comment_reply_link( $args = array(), $comment = null, $post = null |
1598 | 1598 | 'max_depth' => 0, |
1599 | 1599 | 'depth' => 0, |
1600 | 1600 | 'before' => '', |
1601 | | 'after' => '' |
| 1601 | 'after' => '', |
| 1602 | 'limit_by_depth' => true |
1602 | 1603 | ); |
1603 | 1604 | |
1604 | 1605 | $args = wp_parse_args( $args, $defaults ); |
1605 | 1606 | |
1606 | | if ( 0 == $args['depth'] || $args['max_depth'] <= $args['depth'] ) { |
| 1607 | if ( 0 == $args['depth'] ) { |
1607 | 1608 | return; |
1608 | | } |
1609 | | |
| 1609 | } |
| 1610 | |
1610 | 1611 | $comment = get_comment( $comment ); |
1611 | 1612 | |
1612 | 1613 | if ( empty( $post ) ) { |
… |
… |
function get_comment_reply_link( $args = array(), $comment = null, $post = null |
1631 | 1632 | */ |
1632 | 1633 | $args = apply_filters( 'comment_reply_link_args', $args, $comment, $post ); |
1633 | 1634 | |
| 1635 | if ( $args['limit_by_depth'] && ( $args['max_depth'] <= $args['depth'] ) ) { |
| 1636 | return; |
| 1637 | } |
| 1638 | |
1634 | 1639 | if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) { |
1635 | 1640 | $link = sprintf( '<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>', |
1636 | 1641 | esc_url( wp_login_url( get_permalink() ) ), |