@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.