-
Notifications
You must be signed in to change notification settings - Fork 651
Remove permissions checks from get users so we can show public users #1397
Conversation
It sometimes happens that there are more public users than this test case creates it's self, so we can't make it super deterministic.
|
This is failing because we run the unit tests against the latest stable release of WordPress, not trunk - an this PR requires the recent patch that was committed to core. |
|
Fixing the tests up here. |
|
@joehoyle Testing fixed up here. You happy with the PR and ready to merge it? |
|
@rmccue thanks for that, yup I'm ready for a merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we only include posts marked as show_in_rest? Internally, WP grabs types with public => true here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thought was this would only reflect users who were already exposed via the RSS feeds, which could be any public post type, though I guess that's not a guarantee either. show_in_rest might be safer, or literally post_type=post
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point on that. I'm fine with all then. :)
Remove permissions checks from get users so we can show public users
Using the new WordPress
WP_User_Queryhas_published_postsflag we can show only public users that would otherwise be exposed via authors on public posts on the/wp/v2/usersendpoint.See #839