Hello there.
Have two days i’m trying to make a function to change the option(‘default_role’) and save with my own role, where I choose in the register form, but I don’t know what can I do.
look my code.
add_action('pie_register_after_register_validate','my_custom_user_role_cb', 10, 1);
function my_custom_user_role_cb($user){
$new_role = $_POST['radio_5'];
$user = wp_update_user( array ('ID' => $user_id, 'role' => $new_role ) ) ;
}
And I need to approve the account instantly when the user role is like ‘customers’ and when the role is ‘distributors’, only the admin can approve the account.
How can I do these two functions in the action ‘pie_register_after_register_validate’..???
Could you help me, please.
Tks..