Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to retrieve the name of bp_member_type instead of the ID?


  • judahorion
    Participant

    @judahorion

    Hey, there! I am trying to retrieve the current logged in user’s member type, which I have done successfully, but it seems to output the member type id or the membertype slug instead of the actual member type name, making the member types lowercase/appear with underscores if there is an underscore in the ID. How do I retrieve the name instead?

    This is the code I am using

    $member = bp_get_member_type($user_id);

Viewing 3 replies - 1 through 3 (of 3 total)

  • shanebp
    Moderator

    @shanebp

    Try: $member = bp_get_member_type_list($user_id);


    judahorion
    Participant

    @judahorion

    Much, much closer to what I needed, thank you so much! But now it displays ‘Member Type:’ and then lists the member type correctly. How can I get rid of the prepended text “Member type”? and simply just list the name?


    shanebp
    Moderator

    @shanebp

    The arguments are listed in function bp_member_type_list
    in buddypress\bp-members\bp-members-template.php

    There is a $label argument that you could set to an empty string.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar