-
Notifications
You must be signed in to change notification settings - Fork 314
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
Private posts are hidden from admins in regular post index #1870
Comments
This does seem like a bug. CC @oscarssanchez |
Hi @kyleramirez, It looks like this is a duplicate from #1800 could you please confirm this? I also created a PR for this in case this is the same problem: #1813 It would be great if you can try that one out. Thanks! |
#1813 Seems to have fixed this issue. |
I think that the capabilities should be used instead of the role. In my test website, editor can't see private page but can see private post (that setting has been made with “User role editor” plugin). Thanks ! |
Is there any reason ElasticPress needs to modify the query when a search hasn't taken place? |
Hi @johnstonphilip could you please elaborate ? |
Hi @lepatachou , This is more intended to mimic the default behavior of WordPress. As an alternative for now I think you could do this by hooking into pre_get_posts and tweaking the post status argument. |
@oscarssanchez After doing some more digging, it seems that "Protected Content" indexing was turned on, when we didn't want that. By turning it off, all is working as expected. Thanks! |
Closing in favor of #2129 |
Describe the bug
As a logged in administrator on a default front page (regular loop of posts), you can normally see private posts in the same list that you can see other public posts. If you log out and become a regular visitor, only the public posts are shown on the page. This is default WordPress functionality. After turning on ElasticPress, those private posts are missing, showing only the public posts, even as a logged in administrator, even though no search query is present. Additionally, when querying
/wp-json/api/v2/search?search=anything
, no private posts are present.Steps to Reproduce
/wp-admin/admin.php?page=elasticpress
Expected behavior
As an administrator, I should be able to see a mix of public and private posts on my default posts index. ElasticPress should not alter that default query, especially given that no search has occurred.
Environment information
Device: MacBook Pro
OS: macOS Catalina
Browser and version: Chrome 84
WordPress version: 5.5
Site Health Info:
The text was updated successfully, but these errors were encountered: