Wordpress SSO - Restrict Content / user levels / groups

Thanks, Simon! Worked a treat. I got the code working. Turns out the code wrapped around the action was preventing the add_action from running the function. Once I removed the

if ( class_exists( '\WPDiscourse\Discourse\Discourse' ) ) {

and just included the add_action itself, the plugin worked fine. I’m not really worried about the check, because I’m the only person administering this site. So yeah, now syncing works perfectly for both adding and removing members from groups.

Thanks again for your fast and helpful reply.