User Role field - Pie Register
2018-12-12 11:25:26

User Role field

Home Forums Pie-Register 2.0 Support User Role field

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2524

    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?

    #2529

    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

    #2601

    Albert Saliba
    Participant

    Hi all,

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

    Albert

    #2604

    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)

You must be logged in to reply to this topic.