Skip to:
Content
Pages
Categories
Search
Top
Bottom

Is it possible in buddypress that user can register with two role ?

  • @crehiren

    Participant

    Hello,

    I want to add functionality in my site like there are two role for end user {company and employee}.

    Is there any plugin or any custom code available for buddypress registration ?

    Any help would be appreciate 🙂

    Thanks,

Viewing 3 replies - 1 through 3 (of 3 total)
  • @henrywright

    Moderator

    Hi @crehiren

    You can do that quite easily. For example, if you wanted to add a new role to the currently logged-in user then you could do this:

    // Get a WP_User object for the current user.
    $user = wp_get_current_user();
    
    // Use the add_role() method to add the editor role to this user.
    $user->add_role( 'editor' );

    @crehiren

    Participant

    I want this things in registration time. It anyone can check radio on registration time, i want to define that time role for both.

    // Use the add_role() method to add the editor role to this user.
    $user->add_role( ‘editor’ );

    For this method, we can assign role to logged in user, i want it to at register time.

    THanks,

    @crehiren

    Participant

    Anyone can help me out of this ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is it possible in buddypress that user can register with two role ?’ is closed to new replies.
Skip to toolbar