Allow new users to select role

This topic contains 4 replies, has 2 voices, and was last updated by  Alex Rollin 6 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #1115

    Felicia Felicia
    Buyer
    Post count: 140

    Hi,

    How do I add a field in the registration form such that new users can select their role in wordpress?

    Thanks.

    #1117

    Alex Rollin
    Moderator
    Post count: 27815

    Hello!

    UsersWP does not have such a feature at this time.

    In every case I have heard of, it is the job of the Admin to apply a role to new/other users.

    In some cases, members want to offer roles ‘for sale’.

    You can do that with the “Paid Members” addon for WP Invoicing. This applies to users that have already registered and are seeking another role. The ‘price’ can be set to ‘free’.

    https://wpinvoicing.com/looking-for-beta-tester-for-paid-members/

    #1126

    Felicia Felicia
    Buyer
    Post count: 140

    Hi Alex, I understand the approach, but that will be too troublesome for the users.

    Possible if I use this? I have seen this somewhere, but I do not know how to customise it with mine.

    //Create the user
    $user_id = wp_create_user( $username, $password, $email );
    $user = new WP_User( $user_id );

    //If the user selects vendor set the role to vendor
    if( $_POST[‘user_role’] == ‘vendor’ )
    {
    $user->set_role( ‘vendor’ );
    }
    //Else they are a customer
    else
    {
    $user->set_role( ‘customer’ );
    }

    Could you help with this?

    #1127

    Felicia Felicia
    Buyer
    Post count: 140
    This reply has been marked as private.
    #1140

    Alex Rollin
    Moderator
    Post count: 27815

    Hello!

    That would be a customization, but something that one of the GD Experts could help with:

    https://geodirectoryexperts.com/

Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket