# 我无法在WordPress网站上将用户添加到Discourse论坛中，尽管用户已加入会员

**URL:** <https://meta.discourse.org/t/i-cannot-add-user-to-the-discouse-forum-from-a-wordpress-website-when-user-added-in-a-membership/300025>\
**Category:** Development\
**Created:** [2024 年3 月 19 日 16:54 UTC](https://meta.discourse.org/t/i-cannot-add-user-to-the-discouse-forum-from-a-wordpress-website-when-user-added-in-a-membership/300025 "2024-03-19T16:54:32Z")\
**Posts on this page:** 1\
**Showing post:** 23

<div class="post-metadata">

作者： ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
发布日期： [2024 年7 月 30 日 20:33 UTC](https://meta.discourse.org/t/i-cannot-add-user-to-the-discouse-forum-from-a-wordpress-website-when-user-added-in-a-membership/300025/23 "2024-07-30T20:33:18Z")

</div>

我现在不做任何 WordPress 开发，所以我无法测试您的代码。我认为问题出在这里：

` $result = DiscourseUtilities::add_user_to_discourse_group($user_id, $s2member_level_1_groups);`

如果我正确地读取了日志，该调用将返回：

```plaintext
[error_data] => Array
    (
        [wpdc_response_error] => Array
            (
                [http_code] => 404
                [http_body] => {"errors":["The requested URL or resource could not be found."],"error_type":"not_found"}
            )

```

我猜问题在于您的 Discourse 网站上没有名为 `"Member"` 的群组。

我不确定您在这里做什么，但我不认为这与错误有关：

```php
   // Additional SSO parameters if needed
            $sso_params = array();
            $sso_params = apply_filters('wpdc_sso_params', $sso_params, $user_data);

```

---

_[View the full topic](https://meta.discourse.org/t/i-cannot-add-user-to-the-discouse-forum-from-a-wordpress-website-when-user-added-in-a-membership/300025)._
