-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The condition for building the post_status parameter in a simple query #1800
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 #1813 to address this. Could you give it a try see if it solves the issue for you? |
Hi @oscarssanchez |
@brandwaffle even with protected content enabled the query that's being run with ElasticPress does not return results. As we are returning them in the admin, I think we should include them if protected content is enabled and you are logged in as an admin or you have the correct capability |
Documentation added to elasticpress.io: https://elasticpress.zendesk.com/hc/en-us/articles/360061855552-Can-t-see-private-posts-on-the-frontend-if-logged-in-and-have-the-correct-capability |
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!!
The text was updated successfully, but these errors were encountered: