Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: thread_comments_depth_max

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
94
95 <?php
96 /**
97  * Filters the maximum depth of threaded/nested comments.
98  *
99  * @since 2.7.0
100  *
101  * @param int $max_depth The maximum depth of threaded comments. Default 10.
102  */
103 $maxdeep = (int) apply_filters( 'thread_comments_depth_max', 10 );
104
105 $thread_comments_depth = '<select name="thread_comments_depth" id="thread_comments_depth">';
106 for ( $i = 2; $i <= $maxdeep; $i++ ) {
107      $thread_comments_depth .= "<option value='" . esc_attr( $i ) . "'";
108      if ( (int) get_option( 'thread_comments_depth' ) === $i ) {
109           $thread_comments_depth .= " selected='selected'";
110      }
111      $thread_comments_depth .= ">$i</option>";
112 }