User Role field

This topic contains 3 replies, has 3 voices, and was last updated by Avatar Pie Register 4 years, 8 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #10002524
    Avatar
    henkc
    Participant

    I’d like to include a field on the registration page where different user roles can be selected. I have the WP Roles at Registration plugin installed, but I am unable to figure out a way to either integrate the plugin with the Pie Register plugin or to fix the issue in a different way.

    Any suggestions?

    #10002529
    Avatar
    Pie Register
    Keymaster

    Hello,

    You can do it in the following way:

    1.) Add a drop-down menu with desired roles manually (Set this field
    hidden on Profile).
    2.) Add a Hook in your theme’s function.php

    add_action('pie_register_after_register_validate','my_custom_user_role_cb',10,1);
    function my_custom_user_role_cb($user){
             //Put your snippet here to assign user
             // You have User Object to retrieve back the Role Option User
    selected with get_user_meta function
    }

    Hope it helps!

    Thanks

    #10002601
    Avatar
    Albert Saliba
    Participant

    Hi all,

    I need the same functionality tried the code above but didn’t manage. Can you help me out.

    Albert

    #10002604
    Avatar
    Pie Register
    Keymaster

    @Albert

    Hello,

    The above code is just an example of how one should get started.

    Thanks
    Mohsin

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

The forum ‘Pie-Register 2.0 Support’ is closed to new topics and replies.