+ $this->request = apply_filters( 'posts_request_ids', $this->request, $this );
+
+ $ids = $wpdb->get_col( $this->request );
+
+ if ( $ids ) {
+ $this->set_found_posts( $q, $limits );
+
+ _prime_post_caches( $ids, $q['update_post_term_cache'], $q['update_post_meta_cache'] );
+
+ $this->posts = array_map( 'get_post', $ids );
+ } else {
+ $this->found_posts = $this->max_num_pages = 0;
+ $this->posts = array();
+ }
+ } else {
+ $this->posts = $wpdb->get_results( $this->request );
+ $this->set_found_posts( $q, $limits );
+ }
+
+ // Raw results filter. Prior to status checks.