Elasticpress: The condition for building the post_status parameter in a simple query

Created on 11 Jun 2020  Â·  3Comments  Â·  Source: 10up/ElasticPress

Hey guys!
I have a doubt, on post_status parameter of the WP_Query class the default value is‘ publish ‘, but if the user is logged in,‘ private ‘is added, see:
https://developer.wordpress.org/reference/classes/wp_query/#status-parameters

but the elasticpress when on perform query only adds the private status if the request is made through an administrative page and if the user is logged in, see here:
https://github.com/10up/ElasticPress/blob/master/includes/classes/Indexable/Post/Post.php#L1232

any special reason for having this difference?
Thanks!!

question

All 3 comments

Hey @vnmedeiros ,

I think you are right! I did a search with and without elasticpress.

Without, I get some results when looking for a private post. With EP enabled, I get no results.

I'll craft a PR for this.

Hi @vnmedeiros ,

I made https://github.com/10up/ElasticPress/pull/1813 to address this. Could you give it a try see if it solves the issue for you?

Hi @oscarssanchez
cool!
I'll test, thank very much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

blindpet picture blindpet  Â·  7Comments

roditi3811 picture roditi3811  Â·  4Comments

barryceelen picture barryceelen  Â·  4Comments

psorensen picture psorensen  Â·  7Comments

MediaMaquina picture MediaMaquina  Â·  5Comments