WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to allow the reply link to remain on the comment form after I have reached my 10 nested comment limit?

I don't necessarily need nested comments I just need the reply link to be always available as I'm using a plugin that only sends out email notifications on a comment "reply".

share|improve this question
up vote 3 down vote accepted

If you need to modify the max depth, you could use the thread_comments_depth_max filter:

/**
 * Set max comments depth to 15 on the discussion settings page
 */
add_filter( 'thread_comments_depth_max', function( $max )
{
    return 15;
} );

then the dropdown on the discussion settings page will show the range 1 - 15.

But I can imagine very deep comment threads would be harder to read.

Another approach would be to override the thread_comments_depth option value on the front-end:

/**
 * Set max comments depth to 15 on the front-end
 */
add_filter( 'option_thread_comments_depth', function( $val )
{
    if( ! is_admin() )
        $val = 15;

    return $val;
} );

The reason why the reply links don't show for depths greater than the max depth is this part:

if ( 0 == $args['depth'] || $args['max_depth'] <= $args['depth'] ) {
    return;
}

within the get_comment_reply_link() function.

It's not possible to use the comment_reply_link_args filter, because it's applied after the depth check, for some reason.

share|improve this answer
    
"But I can imagine very deep comment threads would be harder to read."... couldn't that be solved with un-nested css styling? – Pete Jan 25 at 11:31
    
yes, that css might be a workaround. If the comment_reply_link_args would be above the depth check, then I think we could have a more dynamic depth and even change the max_depth per comment. @Pete – birgire Jan 25 at 11:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.