[wp-trac] [WordPress Trac] #31383: Add WP_Tax_Query support to WP_User_Query

WordPress Trac noreply at wordpress.org
Thu Oct 13 23:24:34 UTC 2016

#31383: Add WP_Tax_Query support to WP_User_Query
 Reporter:  desrosj          |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Future Release
Component:  Query            |     Version:  4.2
 Severity:  normal           |  Resolution:
 Keywords:  needs-patch      |     Focuses:

Comment (by Qwindoo):


 I need taxonomy query support for user queries as well. The patch seems
 great, however it is not ideal because of the issue mentioned by @desrosj
 : terms are currently assigned to all objects and there's no non-hackish
 way of assigning a term to a specific object type.

 The cleanest way to fix this seems to be adding a new `object_type` column
 in `term_relationships`, alongside `object_id`. This would allow us to
 cleanly distinguish between post-to-term, user-to-term and any other
 future relationships we might want to support. Functions like
 `wp_set_object_terms` could accept an additional argument `$object_type`,
 defaulting to ''post'' in order to preserve existing functionality.

 With this change in place, even without adding the UX stuff, being able to
 assign terms to users and only users and then to query users based on
 these terms seems a compelling enough feature to me.

 Is there a specific workflow in place to request and discuss such a
 database schema change?

Ticket URL: <https://core.trac.wordpress.org/ticket/31383#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list