Create user automatically in Discourse when they sign up in Wordpress?

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.