[wp-trac] [WordPress Trac] #32250: Ability to get_users() who have published posts
WordPress Trac
noreply at wordpress.org
Mon May 4 17:11:54 UTC 2015
#32250: Ability to get_users() who have published posts
-------------------------+-----------------------------
Reporter: joehoyle | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version:
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
Currently there is no easy way to get a list of users who are "public" on
the site. A user is typically public if they have a published viewable
post, as their user is associated with and displayed on that post (both in
the theme and in the feeds).
In the REST API, we ideally want to show publicly available users at
`/wp/users` for unauthenticated requests. Currently WP_User_Query supports
`who = authors` which _actually_ returns a list of users who are user
level 1 or above. In this case, not much use. We already support `GET
/wp/users/123` for a user who say published posts.
I propose another argument be supported for `WP_User_Query` to get said
public authors of the site. I put together an initially patch which adds
`who = public_authors` (though I frankly find "who" to be a super weird
keyword!).
This will basically join the posts table in the query so select anyone who
has a published post of a public post type.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32250>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list