Ticket #22061: 22061.diff
| File 22061.diff, 1.1 KB (added by wonderboymusic, 8 months ago) |
|---|
-
query.php
2772 2772 if ( !$q['suppress_filters'] ) 2773 2773 $this->posts = apply_filters_ref_array('the_posts', array( $this->posts, &$this ) ); 2774 2774 2775 $this->post_count = count( $this->posts );2776 2777 2775 // Ensure that any posts added/modified via one of the filters above are 2778 2776 // of the type WP_Post and are filtered. 2779 if ( $this->posts ) 2777 if ( $this->posts ) { 2778 $this->post_count = count( $this->posts ); 2779 2780 2780 $this->posts = array_map( 'get_post', $this->posts ); 2781 2781 2782 if ( $q['cache_results'] )2783 update_post_caches($this->posts, $post_type, $q['update_post_term_cache'], $q['update_post_meta_cache']);2782 if ( $q['cache_results'] ) 2783 update_post_caches($this->posts, $post_type, $q['update_post_term_cache'], $q['update_post_meta_cache']); 2784 2784 2785 if ( $this->post_count > 0 ) { 2786 $this->post = $this->posts[0]; 2785 $this->post = reset( $this->posts ); 2786 } else { 2787 $this->post_count = 0; 2788 $this->posts = array(); 2787 2789 } 2788 2790 2789 2791 return $this->posts;