SyncGenerator:: addUserToBpGroup (userId美元,美元的类型,美元的删除)
按角色添加用户到bp组
描述
源
文件:bp-乐动体育网站怎样integrations / learndash /图书馆/ SyncGenerator.php
addUserToBpGroup($userId, $type, $remove) {$groupMember = new BP_Groups_Member($userId, $this-> bgroupid); / /删除bp_groupid美元syncTo = $ this - > getLdSyncToRole($类型);if ($remove) {return $groupMember->remove();} $groupMember->group_id = $this->bpGroupId;groupMember - > user_id =美元标识;groupMember - > is_admin = 0;groupMember - > is_mod = 0;groupMember - > is_confirmed = 1;if ('user' != $syncTo) {$ var = "is_{$syncTo}";groupMember - > $ var = 1; } $groupMember->save(); }
更新日志
版本 | 描述 |
---|---|
BuddyBoss 1.0.0 | 介绍了。 |