# Bring das Berechtigungsniveau von WordPress MemberPress rüber

**URL:** https://meta.discourse.org/t/bring-over-permission-level-from-wordpress-memberpress/78074
**Category:** WordPress
**Created:** [15. Januar 2018 um 16:26 UTC](https://meta.discourse.org/t/bring-over-permission-level-from-wordpress-memberpress/78074 "2018-01-15T16:26:13Z")
**Posts on this page:** 1
**Showing post:** 16

<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: [31. März 2018 um 12:30 UTC](https://meta.discourse.org/t/bring-over-permission-level-from-wordpress-memberpress/78074/16 "2018-03-31T12:30:52Z")

</div>

@simon

Thanks, Simon, indeed, my text editor gives curly quotes, 😕

unfortunately the code didn’t help. but… not giving up, 🙂

EDIT! It DID work, i had made an error in matching the names between Groups and WP users.  
**YEEHA!!! couldn’t be happier!!**

BUT… they now get added to ALL groups.  
so i will have to add the php one-by-one, each to their corresponding group.

like: 47281 leads to “Forever Free”  
the next two lead to “Creative License” etc.

RE-EDIT:  
I’ve inserted the code through my plugin in various ways. (i tried making a separate entrance for every group, but clearly you can only add one filter and the rest should follow within that one filter)

some of my attempts were directly bounced, so i discarded those.  
the code below has been accepted, but it’s not working properly.

the first group works as it should. but then the next don’t, so i’m making a mistake in the code.

RE-EDIT: Turns out i had missed the curly quotes again…  
**Problem resolved,**  **the below code works.** (once you take out the curlies 😀😀😀 )

```
   add_filter( 'wpdc_sso_params', 'wpdc_custom_sso_params' );
function wpdc_custom_sso_params( $params ) {
if ( current_user_can( 'mepr-active','memberships:47281' ) ) {
        $params['add_groups'] = 'ForeverFree';
    } else {
        $params['remove_groups'] = 'ForeverFree';
	}
    if ( current_user_can( 'mepr-active','memberships:47295,47299' ) ) {
        $params['add_groups'] = ‘CreativeLicense’;
    } else {
        $params['remove_groups'] = ‘CreativeLicense’;
	}
    if ( current_user_can( 'mepr-active','memberships:47303,47297' ) ) {
        $params['add_groups'] = ‘JoinLive’;
    } else {
        $params['remove_groups'] = ‘JoinLive’;
	}
if ( current_user_can( 'mepr-active','memberships:47301,47305' ) ) {
        $params['add_groups'] = ‘Transform’;
    } else {
        $params['remove_groups'] = ‘Transform’;
	}
if ( current_user_can( 'mepr-active','memberships:48259,48238' ) ) {
        $params['add_groups'] = ‘TransformPlus’;
    } else {
        $params['remove_groups'] = ‘TransformPlus’;
	}
    
	return $params;
}

```

thanks for your help!  
You have NO idea how happy i am. Just … awesome!

:- D.

POST-EDIT:  
to anyone wanting to use this code for their own memberpress/discourse connection: it’s not complete yet!  
when a member upgrades or downgrades, they get added to the new group, but they don’t get removed from the old group. still working on that.

Final Edit:  
Solution can be found here: [Memberpress: how to add users to groups upon Sign up - #11 by simon](https://meta.discourse.org/t/memberpress-how-to-add-users-to-groups-upon-sign-up/83478/11)

---

_[View the full topic](https://meta.discourse.org/t/bring-over-permission-level-from-wordpress-memberpress/78074)._
