[wp-trac] [WordPress Trac] #37837: Extend WP_Query author parameters to filter by role
WordPress Trac
noreply at wordpress.org
Fri Aug 26 10:25:02 UTC 2016
#37837: Extend WP_Query author parameters to filter by role
-----------------------------+-----------------------------
Reporter: jadpm | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version: trunk
Severity: normal | Keywords:
Focuses: |
-----------------------------+-----------------------------
WP_Query contains a series of author parameters (`author', ' author_name',
' author__in', and `author__not_in` as documented on the Codex).
It wpould be nice to add `author_role__in` and maybe `author_role__not_in`
as valid parameters, and be able to also query for posts given one or a
set of user roles. I can see a lot of usages, and this has indeed been
asked inside the community in some places, although I could not find a
Track dedicated ticket.
AFAIK, this would require the WP_Query database interaction to include the
usermeta table, which can be expensive by default, and add a LIKE
statement against the `wp_capabilities` usermeta field value, which is
also expensive by default. So this might introduce performance problems
and be discarded because of that. But otherwise, I would like that we
consider this as a possible feature to add.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37837>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list