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
3719      $option = str_replace( '-', '_', "${screen}_per_page" );
3720      $per_page = (int) get_user_option( $option, 0, false );
3721      if ( empty( $per_page ) || $per_page < 1 ) {
3722           if ( 'plugins' == $screen )
3723                $per_page = 999;
3724           else
3725                $per_page = 20;
3726      }
3727      if ( 'edit_comments_per_page' == $option )
3728           $per_page = apply_filters( 'comments_per_page', $per_page, isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all' );
3729      elseif ( 'categories' == $option )
3730           $per_page = apply_filters( 'edit_categories_per_page', $per_page );
3731      else
3732           $per_page = apply_filters( $option, $per_page );
3733
3734      $return = '<h5>' . __('Options') . "</h5>\n";
3735      $return .= "<div class='screen-options'>\n";
3736      if ( !empty($per_page_label) )
3737           $return .= "<label for='$option'>$per_page_label</label> <input type='text' class='screen-per-page' name='wp_screen_options[value]' id='$option' maxlength='3' value='$per_page' />\n";