# Автоматическое назначение участника в определенную группу

**URL:** https://meta.discourse.org/t/auto-assign-member-to-the-certain-group/157612
**Category:** WordPress
**Created:** [13.Июль.2020 17:00:52 UTC](https://meta.discourse.org/t/auto-assign-member-to-the-certain-group/157612 "2020-07-13T17:00:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dsubash](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dsubash/32/183979_2.png) [@dsubash](https://meta.discourse.org/u/dsubash)
#### Post date: [13.Июль.2020 17:00:52 UTC](https://meta.discourse.org/t/auto-assign-member-to-the-certain-group/157612/1 "2020-07-13T17:00:52Z")

</div>

Автоматически назначать пользователя в определенную группу при регистрации через сайт WordPress после включения SSO с использованием сайта WordPress в качестве провайдера. Я не нашел много информации по этому вопросу на [Setup DiscourseConnect - Official Single-Sign-On for Discourse (sso)](https://meta.discourse.org/t/official-single-sign-on-for-discourse-sso/13045). Не могли бы вы прояснить ситуацию? Спасибо.

---

<div class="post-metadata">

### Author: ![osioke](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osioke/32/238946_2.png) [@osioke](https://meta.discourse.org/u/osioke)
#### Post date: [13.Июль.2020 17:34:47 UTC](https://meta.discourse.org/t/auto-assign-member-to-the-certain-group/157612/2 "2020-07-13T17:34:47Z")

</div>

Проверьте вместо этого здесь:

> [@Manage group membership in Discourse with WP Discourse SSO](https://meta.discourse.org/t/managing-discourse-group-membership-with-wp-discourse-sso/74724):
>
> [WP Discourse](https://github.com/discourse/wp-discourse) functions The [WP Discourse](https://github.com/discourse/wp-discourse) plugin has a couple of functions that can be used to associate WordPress users with Discourse groups. These functions are only enabled on sites that are using WordPress as the SSO provider for Discourse. add\_user\_to\_discourse\_group( $user\_id, $group\_names ) [View Code](https://github.com/discourse/wp-discourse/blob/main/lib/utilities.php#L278-L301) remove\_user\_from\_discourse\_group( $user\_id, $group\_names ) [View Code](https://github.com/discourse/wp-discourse/blob/main/lib/utilities.php#L303-L326) Each of these functions take the same two parameters: $user\_id: the WordPress user’s id $group\_names: a comma separat…

Также для других настроек WordPress попробуйте поискать [`howto wordpress`](https://meta.discourse.org/search?q=%23howto%20wordpress)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [12.Август.2020 17:34:59 UTC](https://meta.discourse.org/t/auto-assign-member-to-the-certain-group/157612/3 "2020-08-12T17:34:59Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
