# Попытка перевести платных участников с WP на Discourse

**URL:** https://meta.discourse.org/t/trying-to-bring-paying-members-from-wp-to-discourse/125201
**Category:** WordPress
**Created:** [08.Август.2019 07:21:20 UTC](https://meta.discourse.org/t/trying-to-bring-paying-members-from-wp-to-discourse/125201 "2019-08-08T07:21:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![helmi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/helmi/32/114772_2.png) [@helmi](https://meta.discourse.org/u/helmi)
#### Post date: [08.Август.2019 07:21:20 UTC](https://meta.discourse.org/t/trying-to-bring-paying-members-from-wp-to-discourse/125201/1 "2019-08-08T07:21:20Z")

</div>

Привет,

пытаюсь подобрать подходящее решение для проекта с членством. В текущем плане рассматривается либо внешний провайдер, либо решение на базе WordPress для обработки платежей. В любом случае пользователи будут храниться в WordPress, и им будут назначаться роли в зависимости от статуса оплаты.

В [этой теме](https://meta.discourse.org/t/role-based-access-control/78606) я прочитал, что группы/роли передаются из WordPress в Discourse, но не смог найти указаний о том, как это настраивается в параметрах плагина [WP Discourse](https://github.com/discourse/wp-discourse).

Может кто-то подсказать, где я могу найти эту информацию? Основная цель — предоставить доступ к форуму только платящим членам. Как только они отменят подписку или что-то подобное, я перемещу их в другие роли в WordPress и хочу, чтобы у них больше не было доступа к Discourse (или, в более сложной конфигурации, доступ только к определённым группам).

Любые советы будут очень кстати. Спасибо!

Хельми

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [08.Август.2019 07:50:46 UTC](https://meta.discourse.org/t/trying-to-bring-paying-members-from-wp-to-discourse/125201/2 "2019-08-08T07:50:46Z")

</div>

Ниже приведены руководства, которые, вероятно, вам нужны:

> [@Manage group membership in Discourse with WP Discourse SSO](https://meta.discourse.org/t/managing-discourse-group-membership-with-wp-discourse/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…

> [@Understanding groups and category permissions](https://meta.discourse.org/t/how-to-use-category-security-settings-to-control-access-to-content/87678):
>
> bookmark This guide explains how to manage category visibility and user permissions using groups in Discourse. person_raising_hand Required user level: Administrator Groups and category permissions are crucial for managing access and content creation within your Discourse community. This guide will help you understand how to use these features effectively. Summary Category permissions control visibility and user actions Permissions are managed through group access lists Different perm…

---

<div class="post-metadata">

### Author: ![helmi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/helmi/32/114772_2.png) [@helmi](https://meta.discourse.org/u/helmi)
#### Post date: [08.Август.2019 11:56:29 UTC](https://meta.discourse.org/t/trying-to-bring-paying-members-from-wp-to-discourse/125201/3 "2019-08-08T11:56:29Z")

</div>

Спасибо, Тейлор. В целом это выглядит как то, что я искал, но это гораздо более хакерское решение, чем я надеялся. Я опасаюсь, что из-за проблем с поддерживаемостью такого хака от него придётся отказаться. Я посмотрю, что ещё можно сделать.

Спасибо!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [08.Август.2019 14:13:33 UTC](https://meta.discourse.org/t/trying-to-bring-paying-members-from-wp-to-discourse/125201/4 "2019-08-08T14:13:33Z")

</div>

Если вы не часто меняете роли участников, это не так уж и плохо.

Если WordPress используется только для управления членством, обратите внимание на Memberful, ProCourse Memberships или Patreon.
