# Please Check Code For Assigning Group to WooCommerce Memberships Members

**URL:** <https://meta.discourse.org/t/please-check-code-for-assigning-group-to-woocommerce-memberships-members/113013>\
**Category:** Product Support\
**Created:** [30 maart 2019 om 16:20 UTC](https://meta.discourse.org/t/please-check-code-for-assigning-group-to-woocommerce-memberships-members/113013 "2019-03-30T16:20:51Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [3 april 2019 om 16:12 UTC](https://meta.discourse.org/t/please-check-code-for-assigning-group-to-woocommerce-memberships-members/113013/5 "2019-04-03T16:12:18Z")

</div>

> [@Bernstein](#):
>
> I wonder if Wordpress has to be the SSO Provider instead of the Client for all of this to function?

Yes, the code you have posted requires WordPress to be the SSO provider. The code at the end of it is adding parameters to the SSO payload that is sent from WordPress to Discourse:

```php
add_filter( 'wpdc_sso_params', 'wpdc_wc_memberships_add_to_dc_group' );

```

Unless you are using WordPress as the SSO provider, the only way to automatically add uses to Discourse groups is to use the Discourse API.

---

_[View the full topic](https://meta.discourse.org/t/please-check-code-for-assigning-group-to-woocommerce-memberships-members/113013)._
