bp_get_member_type, unassign member_type to user

  • Participant
    Level: Initiated
    Posts: 2
    Nicolas Joly on #35916


    I have 2 users with member types ‘wp-test’

    In functions.php, i just write this :
    $member_type = bp_get_member_type( 2 ); // userid 2

    After in Users list with filter by member types ‘wp-test’, i have well 2 users, but the Member types in the list disappear for the user 2 ???


    An idea ?
    Thank you !

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2541
    Ravi on #35927

    Hello Nicolas,

    Thank you for posting. Direct calling is a bad idea because member type might be not registered at the time of calling. Please try something like following:

    add_action( 'bp_template_redirect', function () {
    	$member_type = bp_get_member_type( 24 );
    } );

    Please let me know if you need further assistance.


You must be logged in to reply to this topic.

This topic is: not resolved