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
168           $this->set_hierarchical_display(
169                is_post_type_hierarchical( $this->screen->post_type )
170                && 'menu_order title' === $wp_query->query['orderby']
171           );
172
173           $post_type = $this->screen->post_type;
174           $per_page  = $this->get_items_per_page( 'edit_' . $post_type . '_per_page' );
175
176           /** This filter is documented in wp-admin/includes/post.php */
177           $per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type );
178
179           if ( $this->hierarchical_display ) {
180                $total_items = $wp_query->post_count;
181           } elseif ( $wp_query->found_posts || $this->get_pagenum() === 1 ) {
182                $total_items = $wp_query->found_posts;
183           } else {
184                $post_counts = (array) wp_count_posts( $post_type, 'readable' );
185
186                if ( isset( $_REQUEST['post_status'] ) && in_array( $_REQUEST['post_status'], $avail_post_stati, true ) ) {