# Memberpress：如何在注册时将用户添加到组

**URL:** <https://meta.discourse.org/t/memberpress-how-to-add-users-to-groups-upon-sign-up/83478>\
**Category:** WordPress\
**Created:** [2018年三月21日 13:48 UTC](https://meta.discourse.org/t/memberpress-how-to-add-users-to-groups-upon-sign-up/83478 "2018-03-21T13:48:54Z")\
**Posts on this page:** 1\
**Showing post:** 34

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [2020年八月15日 22:37 UTC](https://meta.discourse.org/t/memberpress-how-to-add-users-to-groups-upon-sign-up/83478/34 "2020-08-15T22:37:15Z")

</div>

> [@Solari](#):
>
> 正如 Dani1 提到的，她说只有在用户注销后才会生效。

如果用户通过正常的 SSO 登录流程进行更新，则更新要等到他们注销并重新登录后才会生效。上面的代码示例是解决该问题最简单的方法，但可能并不是管理组成员身份的最佳方式。

当 WordPress 作为 Discourse 的 SSO 提供商站点时，[WP Discourse](https://github.com/discourse/wp-discourse) 插件提供了一些辅助函数。这些函数允许您更新组成员身份，而无需用户注销 Discourse。这些函数位于 Richard 链接的主题中：[https://meta.discourse.org/t/managing-discourse-group-membership-with-wp-discourse-sso/74724。](https://meta.discourse.org/t/managing-discourse-group-membership-with-wp-discourse-sso/74724%E3%80%82)

[Richard 链接的帖子](https://meta.discourse.org/t/bring-over-permission-level-from-wordpress-memberpress/78074/2?u=simon_cossar)详细介绍了这两种不同的方法。我将在下周将这些细节添加到 #howto 主题中。目前，最好先阅读该帖子。

---

_[View the full topic](https://meta.discourse.org/t/memberpress-how-to-add-users-to-groups-upon-sign-up/83478)._
