@simon
Simon, if i understood you correctly, this is what it should now look like.
(iād have used colours - except i donāt know howā¦)
but⦠I may not have completely understood what to do with the final parameters.
i first included them āonce, at the endā, then, when that didnāt work, i included them āafter every statementā.
the plug-in accepts the code as valid, but users do not get removed from the old group, so in functionality this one remains the same as what i started with.
add_filter( 'wpdc_sso_params', 'wpdc_custom_sso_params' );
function wpdc_custom_sso_params( $params ) {
if ( current_user_can( 'mepr-active','memberships:48259,48238' ) ) {
$params['add_groups'] = 'TransformPlus';
} else {
$remove_groups[] = 'TransformPlus';
} {
$params['remove_groups'] = join( 'ForeverFree','CreativeLicense','JoinLive','Transform','TransformPlus', $remove_groups );
}
if ( current_user_can( 'mepr-active','memberships:47303,47305' ) ) {
$params['add_groups'] = 'Transform';
} else {
$remove_groups[] = 'Transform';
} {
$params['remove_groups'] = join( 'ForeverFree','CreativeLicense','JoinLive','Transform','TransformPlus', $remove_groups );
}
if ( current_user_can( 'mepr-active','memberships:47299,47301' ) ) {
$params['add_groups'] = 'JoinLive';
} else {
$remove_groups[] = 'JoinLive';
} {
$params['remove_groups'] = join( 'ForeverFree','CreativeLicense','JoinLive','Transform','TransformPlus', $remove_groups );
}
if ( current_user_can( 'mepr-active','memberships:47295,47297' ) ) {
$params['add_groups'] = 'CreativeLicense';
} else {
$remove_groups[] = 'CreativeLicense';
} {
$params['remove_groups'] = join( 'ForeverFree','CreativeLicense','JoinLive','Transform','TransformPlus', $remove_groups );
}
if ( current_user_can( 'mepr-active','memberships:47281' ) ) {
$params['add_groups'] = 'ForeverFree';
} else {
$remove_groups[] = 'ForeverFree';
} {
$params['remove_groups'] = join( 'ForeverFree','CreativeLicense','JoinLive','Transform','TransformPlus', $remove_groups );
}
return $params;
}
i understand that you canāt go too deeply into this matter, but youāre my last resort.
iāve asked everywhere else, including memberpress and the developers they recommend.
i donāt speak php, at all. everything iāve done so far is extrapolate from the snippets of code iāve found left and right - particularly the pieces youāve shared with me.
as it is right now, iām āhappyā, because people get put into the correct groups. but they donāt get taken out of the old one, and so thatās more steps for me to keep track of ā so if thereās any way you might provide the missing code, that would just be⦠awesomeā¦
thanks!
p.s., inverting the order did not help.