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
2256                $cwhere = apply_filters('comment_feed_where', "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'");
2257                $comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere ORDER BY comment_date_gmt DESC LIMIT " . get_option('posts_per_rss');
2258                $this->comments = $wpdb->get_results($comments_request);
2259                $this->comment_count = count($this->comments);
2260           }
2261
2262           if ( !empty($limits) ) {
2263                $found_posts_query = apply_filters( 'found_posts_query', 'SELECT FOUND_ROWS()' );
2264                $this->found_posts = $wpdb->get_var( $found_posts_query );
2265                $this->found_posts = apply_filters( 'found_posts', $this->found_posts );
2266                $this->max_num_pages = ceil($this->found_posts / $q['posts_per_page']);
2267           }
2268
2269           // Check post status to determine if post should be displayed.
2270           if ( !empty($this->posts) && ($this->is_single || $this->is_page) ) {
2271                $status = get_post_status($this->posts[0]);
2272                //$type = get_post_type($this->posts[0]);
2273                if ( ('publish' != $status) ) {
2274                     if ( ! is_user_logged_in() ) {