# 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:** 4

<div class="post-metadata">

### Author: ![Dani1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dani1/32/84172_2.png) [@Dani1](https://meta.discourse.org/u/Dani1)
#### Post date: [2018年三月28日 16:00 UTC](https://meta.discourse.org/t/memberpress-how-to-add-users-to-groups-upon-sign-up/83478/4 "2018-03-28T16:00:30Z")

</div>

@simon

Hi Simon, I have been looking into the various bits and pieces of info provided but can’t figure out how to connect the dots.

I’ve created the corresponding group names as user roles in WP, but I don’t know what it means to “add the Discourse group names to the SSO payload. You can do this by hooking into the `wpdc_sso_params` filter,” ---- like you mentioned in @apautler Andrew’s post.

Further down in that post, Andrew mentions he found ‘the right code’ - which seems to be what i need as well… but i have no idea where to stick it:

> [@Bring over permission level from WordPress MemberPress](https://meta.discourse.org/t/bring-over-permission-level-from-wordpress-memberpress/78074/3):
>
> Thanks for the quick response @simon. I think I am going to try to go with the first option. Because the free membership isn’t setup on the live WordPress site yet, I am having a hard time testing this. Here is the code that I have now: add\_filter( 'wpdc\_sso\_params', 'wpdc\_custom\_sso\_params', 10, 2 ); function wpdc\_custom\_sso\_params( $params, $user ) { if ( current\_user\_can('mepr-active','memberships:12856') ) { $params['add\_groups'] = 'Academy\_Free'; // Don't use spaces between names…

Would appreciate some further insight, thank you!

Dani

---

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