[buddypress-trac] [BuddyPress Trac] #6006: User Types API

buddypress-trac noreply at wordpress.org
Wed Nov 19 16:18:11 UTC 2014


#6006: User Types API
--------------------------+------------------
 Reporter:  boonebgorges  |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  2.2
Component:  Core          |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------
Changes (by boonebgorges):

 * keywords:   => has-patch


Comment:

 [attachment:6006.patch] is a first pass at adding member type support. (I
 decided to go with "member" type because that's the term we use elsewhere
 in BP.) Here's a summary:

 * Added the minimal amount of taxonomy wrappers necessary make it work.
 See #6028.
 * The functions for registering and fetching taxonomy types are:
 `bp_register_member_type()`, `bp_get_member_type_object()`,
 `bp_get_member_types()`. These mirror their post-type brethren exactly.
 Member type objects currently support very few arguments - just some
 minimal 'labels'. This can be expanded as we come up with new stuff to
 support.
 * The functions for handling member type for specific users are:
 `bp_set_member_type()`, `bp_get_member_type()`. I don't like how the
 latter function is close to `bp_get_member_types()` and `_type_object()`.
 But I wanted to keep the function names and their syntax simple, because
 these CRUD functions are the ones that plugin authors are going to be
 using the most frequently. Feedback welcome on this point.
 * When member types are detected, a meta box is added to the Community
 Profile page in the Dashboard. You can use this to change type for a given
 user.
 * 'member_type' support has been added to `BP_User_Query`. Accepts a
 single value, comma-separated values, or an array. I was going to add
 support for 'any' and 'none', but it's made a bit complicated by some
 limitations in WP's API. See http://core.trac.wordpress.org/ticket/29181.
 This can be added later if people want it. As for the issues that
 johnjamesjacoby describes above: I've put the logic into a subquery, so it
 should not be an issue for the time being. I think this will be more than
 fine for 99.9% of installations, and we should iterate for the .1% if we
 find that performance is somehow limited.

 [attachment:bp-member-type-test.php] is a simple mu-plugin that shows how
 to register member types.

 I think this is getting pretty close to an MVP for 2.2, but I would
 definitely value feedback from other members of the team before moving
 forward. Thanks!

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


More information about the buddypress-trac mailing list