Set Role On Register
-
I’m using this code, but it isn’t working:
add_action("user_register", "onRegister", 50, 1); function onRegister($id) { $user = get_user_by('id', $id); $user->set_role('s2member_level1'); }
Users remain ‘subscribers’ (level 0). Why?
When users register, I send them on a landing page.
If I put the same above code on the landing page (using a PHP Plugin), users get the new role.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Set Role On Register’ is closed to new replies.