this is an awesome idea
The option to create a new user wasnât working for me so I dug into the plugin code and figured out why. In case this is helpful to anyone else:
The create_discourse_user function runs as a result of WPâs wp_login action but for some reason, wp_login doesnât get fired in my setup of WP when someone creates an account.
Itâs probably because we use the WP plugin MemberMouse to handle members and it hijacks the registration/login system in unexpected ways.
So I added in a new way of firing off create_discourse_user and it works now.
any instructions on implementing this?
It can be done with the WP Discourse plugin. You need to be using WordPress as the SSO provider for Discourse and also select the SSO Provider option Create or Sync Discourse Users on Login.
There are cases where this doesnât work due to conflicts with other plugins. If you run into a problem with it, let us know and weâll try to work it out.
The code that I posted in this topic is no longer necessary.
Hello,
I activated the WordPress as the SSO provider for Discourse and also select the SSO Provider option Create or Sync Discourse Users on Login
But after a login with a new user, this user doesnât appear in discourseâs back office.
Do you have an idea for solve that ?
Thanks for your help
Eric
Is SSO working correctly for you when a user clicks the Login button on Discourse?
Yes the SSO is working fine, I can connect to discourse and the user is created at this moment.
But For my project I need to create the user after account creation in wordpress because for some users I want to change the level of them after a subscription in wordpress.
Thanks for your help
This should work. Sometimes there is a conflict with another plugin. What are the main plugins on your site?
I find the problem the publishing username of my api has a space and special characters, after i Changed it on the configuration, the transmission is ok:
Thanks
Great! Yes, that makes sense. SSO works without the API key, but the sync_user function requires the API key and Publishing Username.