[buddypress-trac] [BuddyPress] #3205: Usermeta parameters for bp_has_members()

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Mon May 9 16:22:43 UTC 2011


#3205: Usermeta parameters for bp_has_members()
--------------------------+--------------------------
 Reporter:  boonebgorges  |      Owner:  boonebgorges
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  1.3
Component:  Core          |    Version:  1.2.8
 Keywords:                |
--------------------------+--------------------------
 As I mentioned in IRC, I would like to introduce params to
 bp_has_members() that will allow filtering by usermeta. See the attached
 patch for a very basic first pass.

 The idea is this: users very frequently have a need to filter member lists
 based on an arbitrary criteria. (I'd say that over 50% of my projects
 require this.) The only real way to make this work at the moment is to put
 filters directly on the SQL query, but for obvious reasons this is not
 ideal. By adding meta_key and meta_value params to bp_has_members, we
 allow site builders to manipulate the loop much more efficiently.

 The attached patch is a bare-bones approach. Ideally, I would have
 employed a full meta_query approach, as in WP 3.1 (which would have eased
 the transition to CPTs in BP 1.4). But that isn't easy to do right now,
 because of the URL-style querystring method used to pass arguments to
 bp_has_members(). But there is currently backpat support for meta_value
 and meta_key params in WP_Meta_Query, so even if we modify the way that
 these params work in BP 1.4, existing plugins/themes should upgrade pretty
 seamlessly.

-- 
Ticket URL: <https://trac.buddypress.org/ticket/3205>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list