[buddypress-trac] [BuddyPress Trac] #6418: Introduce functionality to query members by member_type where member_type NOT IN

buddypress-trac noreply at wordpress.org
Wed May 6 13:51:37 UTC 2015


#6418: Introduce functionality to query members by member_type where member_type
NOT IN
---------------------------------+--------------------
 Reporter:  lakrisgubben         |       Owner:
     Type:  enhancement          |      Status:  new
 Priority:  normal               |   Milestone:  2.4
Component:  Component - Members  |     Version:  2.2.3
 Severity:  normal               |  Resolution:
 Keywords:                       |
---------------------------------+--------------------
Changes (by boonebgorges):

 * keywords:  needs-unit-tests =>


Comment:

 Thanks lakrisgubben! These unit tests look outstanding.

 I've reworked the internals of the patch a bit so that we can avoid
 repetition. Because you've optend to follow `WP_Query` in ignoring
 `member_type` altogether when `member_type__not_in` is present, I've
 rolled back my original suggestion that you create a single tax_query that
 contains multiple clauses - it's not needed anymore. I also simplified the
 regex necessary to parse the NOT IN clause.

 Looking more carefully at this, I am concerned that it's not possible to
 make a query for users who have no member type at all. Can you have a look
 at this? I wonder if we might set the default value of `member_type__in`
 to `null`, and then parse it when `! is_null( $member_type__in )`, instead
 of `! empty()`. This would allow devs to pass `'member_type' => array()`
 to return only those users who have no member types. What do you think?

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6418#comment:6>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list