Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Chad Butler

    (@cbutlerjr)

    Yes – the plugin assigns whatever role is set in the WP setting “New User Default Role” under Settings > General.

    Alternatively, you could create an action function hooked to wpmem_post_register_data to set/change/update a user role.
    https://rocketgeek.com/plugins/wp-members/docs/filter-hooks/wpmem_post_register_data/

    Josh68

    (@josh68)

    Hello, Chad

    I have a question based on this. I have been advised that our client will really want to have a set of custom user roles for members. I realize your plugin doesn’t manage custom roles, but we also looked at Members (a custom role solution) when we selected WP-Members as a membership solution.

    I see I can add a registration field of my own choosing, and have gone ahead and added a Select I’ve called “Member Role,” to which I’ve assigned three name/value options. I’ve made this control required.

    Is it wrong of me to think I could capture this value on registration, using the https://rocketgeek.com/plugins/wp-members/docs/filter-hooks/wpmem_register_data/ method, and then assign a desired custom role to that new member before the member profile is saved to the database?

    Thanks in advance for any thoughts, and also for the excellent plugin.

    Regards,

    Josh Schneider

    Plugin Author Chad Butler

    (@cbutlerjr)

    I would do it all within the wpmem_post_regsiter_data action (documentation linked above) because you can pick up the value that the user registered with and then set/reset the user’s role to another role based on that value if necessary.

    There’s also a function in the plugin’s API for setting/updating a user’s role:
    wpmem_update_user_role( $user_id, $role )

    Josh68

    (@josh68)

    Excellent. Thanks so much.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Assign user role to new registaration’ is closed to new replies.