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
1893      $per_page = (int) get_user_option( $option );
1894      if ( empty( $per_page ) || $per_page < 1 ) {
1895           if ( isset($wp_current_screen_options['per_page']['default']) )
1896                $per_page = $wp_current_screen_options['per_page']['default'];
1897           else
1898                $per_page = 20;
1899      }
1900
1901      if ( 'edit_comments_per_page' == $option )
1902           $per_page = apply_filters( 'comments_per_page', $per_page, isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all' );
1903      elseif ( 'categories_per_page' == $option )
1904           $per_page = apply_filters( 'edit_categories_per_page', $per_page );
1905      else
1906           $per_page = apply_filters( $option, $per_page );
1907
1908      // Back compat
1909      if ( isset( $screen->post_type ) )
1910           $per_page = apply_filters( 'edit_posts_per_page', $per_page, $screen->post_type );
1911