WordPress filter hook · part of WordPress core

thread_comments_depth_max

A WordPress core filter that 3 plugins also fire themselves, running on 20+ sites between them.

“Filter the maximum depth of threaded/nested comments.”

How to use thread_comments_depth_max

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'thread_comments_depth_max', function( $value ) {
	// Change $value here.
	return $value;
}, 10, 1 );

Argument names come from Blog Templates's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

3 plugins that fire thread_comments_depth_max

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Blog Templates icon Blog Templates10+ installs apply_filters( 'thread_comments_depth_max', 10 ) gb-blog-templates.php:945
  2. Per Post Comment Settings icon Per Post Comment Settings10+ installs apply_filters( 'thread_comments_depth_max', 10 ) per-post-comment-settings.php:170
  3. WP Core Settings Reduction Project icon WP Core Settings Reduction ProjectFewer than 10 installs apply_filters( 'thread_comments_depth_max', 10 ) replacements/options-discussion.php:89

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.