[buddypress-trac] [BuddyPress Trac] #6138: Member Types API: bp_has_user_member_type()

buddypress-trac noreply at wordpress.org
Mon Jan 19 13:46:29 UTC 2015

#6138: Member Types API: bp_has_user_member_type()
 Reporter:  Offereins                   |       Owner:
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  2.3
Component:  Members                     |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |
Changes (by boonebgorges):

 * milestone:  Awaiting Review => 2.3


 Yes, let's do something like this for 2.3. I want to spend some more time
 thinking about the desired behavior of this function: you're referencing
 the *logged-in* user, but we don't have many functions like that in BP
 (and the ones that are are called `_loggedin_`). Usually our template
 functions like this refer to the *displayed* user, or the current user in
 a template loop.

 > PPS. If I'm not mistaken, member types may be registered with label-like
 type names, i.e. they are not sanitized in any way within BP's functions.
 Hence checking for member types cannot be done with slug-like type names

 You are correct that we're not running the `$member_type` through
 `sanitize_slug()` like `register_post_type()` does - I'll open a separate
 ticket about that. However, I don't see what this has to do with checking
 "slug-like type names". `in_array()` in your proposed function will work
 fine in any case, right? Array keys can contain spaces and capital

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6138#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list