• Resolved Will

    (@silvercats)


    Is there a hook to add user ids to a user group? I am adding a newly registered user from wp-memebers to a user group in your forum plugin.

    I am using this:

    // add new user\subscribers from wp-members to usergroup\members agaros forum plugin
    function rollins_add_forum_member_usergroup($fields) {	
    	$user_id=$fields['ID'];
    	$user_groups='Members';	
    	$AsgarosForumUserGroups = new AsgarosForumUserGroups;
        $AsgarosForumUserGroups->updateUserProfileFields($user_id, $user_groups);
    }
    add_filter('wpmem_post_register_data', 'rollins_add_forum_member_usergroup', 10, 2);
Viewing 1 replies (of 1 total)
  • Plugin Author Asgaros

    (@asgaros)

    Hello

    sorry for the late reply. Basically you can add new groups to a user with the following function:

    wp_set_object_terms($user_id, $user_groups, 'asgarosforum-usergroup', false);

    $user_id: The ID of the user
    $user_groups: An array with the IDs of the user groups which you want to add to the user

Viewing 1 replies (of 1 total)
  • The topic ‘Hook’ is closed to new replies.