Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: comments_per_page

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
178      <label class="screen-reader-text" for="comment-search-input"><?php _e( 'Search Comments' ); ?>:</label>
179      <input type="text" id="comment-search-input" name="s" value="<?php _admin_search_query(); ?>" />
180      <input type="submit" value="<?php esc_attr_e( 'Search Comments' ); ?>" class="button" />
181 </p>
182
183 <?php
184 $comments_per_page = get_user_option('edit_comments_per_page');
185 if ( empty($comments_per_page) )
186      $comments_per_page = 20;
187 $comments_per_page = apply_filters('comments_per_page', $comments_per_page, $comment_status);
188
189 if ( isset( $_GET['apage'] ) )
190      $page = abs( (int) $_GET['apage'] );
191 else
192      $page = 1;
193
194 $start = $offset = ( $page - 1 ) * $comments_per_page;
195
196 list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5, $post_id, $comment_type ); // Grab a few extra