Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: edit_posts_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
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
1912      $return = "<div class='screen-options'>\n";
1913      if ( !empty($per_page_label) )
1914           $return .= "<input type='text' class='screen-per-page' name='wp_screen_options[value]' id='$option' maxlength='3' value='$per_page' /> <label for='$option'>$per_page_label</label>\n";
1915      $return .= get_submit_button( __( 'Apply' ), 'button', 'screen-options-apply', false );
1916      $return .= "<input type='hidden' name='wp_screen_options[option]' value='" . esc_attr($option) . "' />";
1917      $return .= "</div>\n";
1918      return $return;
1919 }