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
256      <label class="screen-reader-text" for="comment-search-input"><?php _e( 'Search Comments' ); ?>:</label>
257      <input type="text" id="comment-search-input" name="s" value="<?php _admin_search_query(); ?>" />
258      <input type="submit" value="<?php esc_attr_e( 'Search Comments' ); ?>" class="button" />
259 </p>
260
261 <?php
262 $comments_per_page = (int) get_user_option( 'edit_comments_per_page' );
263 if ( empty( $comments_per_page ) || $comments_per_page < 1 )
264      $comments_per_page = 20;
265 $comments_per_page = apply_filters( 'comments_per_page', $comments_per_page, $comment_status );
266
267 if ( isset( $_GET['apage'] ) )
268      $page = abs( (int) $_GET['apage'] );
269 else
270      $page = 1;
271
272 $start = $offset = ( $page - 1 ) * $comments_per_page;
273
274 list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 8, $post_id, $comment_type ); // Grab a few extra