Loading...

Gabriel Costa

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Role Editor and different Activation #10004028
    Gabriel Costa
    Participant

    Hey Hasnain, tks for your reply, but it’s not working. I tried =(
    look.

    add_action( 'user_register', 'my_custom_user_role_cb', 10, 1 );
    function my_custom_user_role_cb( $user_id ) {
        if ( isset( $_POST['radio_5'] ) ) {
            update_user_meta($user_id, 'role', 'custormers');
            // wp_update_user( array ('ID' => $user_id, 'role' => 'customers' ) ) ;
        }
    }

    I think the problem is with the $user_id, It’s return ‘null’.

    Some thing else?

Viewing 1 post (of 1 total)