EP_WP_Query_Integration::filter_the_posts PHP Method

filter_the_posts() public method

Filter the posts array to contain ES query results in EP_Post form. Pull previously queried posts.
public filter_the_posts ( array $posts, &$query ) : array
$posts array
return array
    public function filter_the_posts($posts, &$query)
    {
        if (!ep_elasticpress_enabled($query) || apply_filters('ep_skip_query_integration', false, $query) || !isset($this->posts_by_query[spl_object_hash($query)])) {
            return $posts;
        }
        $new_posts = $this->posts_by_query[spl_object_hash($query)];
        return $new_posts;
    }