User Group Metadata
Quote from Apos37 on May 22, 2017, 9:49 pmMy registration page is built with Gravity Forms. I want to be able to choose a user group from the registration page using the user group metadata and a drop down custom field. Does anybody know what the metadata is so I can accomplish this?
My registration page is built with Gravity Forms. I want to be able to choose a user group from the registration page using the user group metadata and a drop down custom field. Does anybody know what the metadata is so I can accomplish this?
Quote from Asgaros on May 22, 2017, 10:19 pmHello gogrw,
the name of the usergroup-taxonomy is: asgarosforum-usergroup
There are also a couple of functions in the AsgarosForumUserGroups class you can use:
// Returns all usergroups. public static function getUserGroups(); // Returns usergroup by id/slug/name/term_taxonomy_id. public static function getUserGroupBy($value, $by = 'id'); // Returns color of usergroup. public static function getUserGroupColor($term_id); // Returns usergroups of user. public static function getUserGroupsForUser($user_id, $fields = 'all'); // Returns users in usergroup. public static function getUsersInUserGroup($usergroup_id); // Counts users in usergroup. public static function countUsersInUserGroup($usergroup_id); // Checks if a user is in a specific user group. public static function isUserInUserGroup($userID, $userGroupID);In your case the following function could be interesting:
$allGroups = AsgarosForumUserGroups::getUserGroups();
Hello gogrw,
the name of the usergroup-taxonomy is: asgarosforum-usergroup
There are also a couple of functions in the AsgarosForumUserGroups class you can use:
// Returns all usergroups. public static function getUserGroups(); // Returns usergroup by id/slug/name/term_taxonomy_id. public static function getUserGroupBy($value, $by = 'id'); // Returns color of usergroup. public static function getUserGroupColor($term_id); // Returns usergroups of user. public static function getUserGroupsForUser($user_id, $fields = 'all'); // Returns users in usergroup. public static function getUsersInUserGroup($usergroup_id); // Counts users in usergroup. public static function countUsersInUserGroup($usergroup_id); // Checks if a user is in a specific user group. public static function isUserInUserGroup($userID, $userGroupID);
In your case the following function could be interesting:
$allGroups = AsgarosForumUserGroups::getUserGroups();