Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: found_posts

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
2592                $climits = apply_filters_ref_array('comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
2593                $comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits";
2594                $this->comments = $wpdb->get_results($comments_request);
2595                $this->comment_count = count($this->comments);
2596           }
2597
2598           if ( !$q['no_found_rows'] && !empty($limits) ) {
2599                $found_posts_query = apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) );
2600                $this->found_posts = $wpdb->get_var( $found_posts_query );
2601                $this->found_posts = apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$this ) );
2602                $this->max_num_pages = ceil($this->found_posts / $q['posts_per_page']);
2603           }
2604
2605           // Check post status to determine if post should be displayed.
2606           if ( !empty($this->posts) && ($this->is_single || $this->is_page) ) {
2607                $status = get_post_status($this->posts[0]);
2608                $post_status_obj = get_post_status_object($status);
2609                //$type = get_post_type($this->posts[0]);
2610                if ( !$post_status_obj->public ) {