Map custom User Fields

I wouldn’t make any direct changes to the plugin’s code unless you are certain about what you are doing. The WP Discourse plugin is built to allow it to be extended by a plugin or a theme by using action hooks. This allows you to customize the plugin without making changes that will be overridden when you update the plugin.

To add data to the SSO payload that is sent to Discourse, use the wpdc_sso_params' filter. Functions that hook into that filter are passed two parameters: $params(an array of SSO parameters that are passed to Discourse) and $user` (the WordPress user object.)

There is an example of how to use the filter in this post:

Let me know if you have any trouble using the filter to add your custom userfield data.

4 Likes