Merging existing Discourse and WP user lists

There are a couple of ways that users can be added to and removed from groups. The easiest way to do it is to use the add_groups and remove_groups SSO parameters. That approach is outlined here: Bring over permission level from WordPress MemberPress. The issue with this approach is that it requires users to log out and log back in again before their group memberships will get updated.

The other approach is to use the add_user_to_discourse_group and remove_user_from_discourse_group functions that are outlined in this topic: Managing Discourse group membership with WP Discourse. The benefi of that approach is that it’s not dependant on the user logging out - their membership levels will be changed as soon as the functions are called.

5 Likes