クラス WP_Query::set_found_posts()
2014/12/16
WP_Query::set_found_posts()
定義ファイル :/blog/wp-includes/query.php 7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | private function set_found_posts( $q, $limits ) { global $wpdb; // Bail if posts is an empty array. Continue if posts is an empty string, // null, or false to accommodate caching plugins that fill posts later. if ( $q['no_found_rows'] || ( is_array( $this->posts ) && ! $this->posts ) ) return; if ( ! empty( $limits ) ) { $this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) ) ); } else { $this->found_posts = count( $this->posts ); } $this->found_posts = apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$this ) ); if ( ! empty( $limits ) ) $this->max_num_pages = ceil( $this->found_posts / $q['posts_per_page'] ); } |