• Resolved flopetit76

    (@flopetit76)


    Hi,

    I have a register form and i want to automatically add the user to a group based on a year field the user fills.

    For example, if this field is filled with “2022”, i want to add the user in the group “endo2022”.

    I want to use this line of code :
    Groups_User_Group::create( array( ‘user_id’ => $user_id, ‘group_id’ => $group_id ) );

    All i need now is to get the group id i want. Can you help me ?

    Thx

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Get a group id by name’ is closed to new replies.