[buddypress-trac] [BuddyPress Trac] #6188: Member Types API: remove a user's member type

buddypress-trac noreply at wordpress.org
Thu Feb 5 15:35:00 UTC 2015

#6188: Member Types API: remove a user's member type
 Reporter:  Offereins                   |       Owner:
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  2.3
Component:  Component - Members         |     Version:  2.2
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |
Changes (by boonebgorges):

 * keywords:  has-patch => has-patch needs-unit-tests


 Good catch, Offereins, and thanks for the patch. As a temporary
 workaround, you can do something like this to remove member type 'foo' but
 not 'bar';

 // array( 'foo', 'bar' )
 $current_types = bp_get_member_type( $user_id, false );
 bp_set_member_type( $user_id, '' );
 foreach ( $current_types as $type ) {
     if ( 'foo' == $type ) {

     bp_set_member_type( $user_id, $type, true );

 The patch looks good, though I'd say that the function should return
 `false` if the user does not have the member type passed to the function
 (since nothing was deleted). This is how other WP delete functions work.

 Let's get some unit tests for this, and put it in for 2.3.

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

More information about the buddypress-trac mailing list