Anyone dealt with carrying over user metadata via the WordPress Discourse bridge?

I have things working nicely where if a user clicks Login on the Discourse, it sends them to our WordPress website where they can log in, and upon successful login it redirects them to the Discourse and they’re logged into it. (All logins are created on the WP site.)

I’ve also made this work for my users who log in with Patreon on the WP site, and it also correctly redirects back to the Discourse on successful login.

Now, I realize there is a Patreon plugin for Discourse that I can install and that would help put users into a Group.

However: my problem is that on our site, users can either sign up with a paid account via Patreon, sign up for a paid account natively (using Stripe), or make a free account. In all cases, a user account exists in the WP site and that’s what Discourse is syncing with. BUT, I’d like to carry over (or rely on in some way) a field from WP that indicates if the user is a premium user into Discourse. Ideally, putting them into a “Patrons” Group if they have this field on the Discourse end.

Has anyone done this? At a high level, what was your approach?

Maybe look at Wordpress Groups Sync with Discourse

2 Likes

Hell yeah, the link in there is exactly what I need!

1 Like