The discussion revolves around restricting WordPress content based on Discourse user groups, with the user seeking a way to use Discourse as an SSO host. anon36484860 asks about restricting content in WordPress based on Discourse groups and inquires about a custom shortcode to check group status. itsbhanusharma notes that such functionality isn’t available yet but may be added in the future. simon confirms that the WP Discourse plugin (version 1.5.0) includes functions that can be adapted for this purpose, even though they were designed for the reverse use case. simon also mentions a pending update to the get_discourse_user function to include group data, which will be available later in the week.
I have a premium group in my forum which I want to provide access to exclusive content in wordpress.
Is there any way to restrict certain wordpress pages or content based on Discourse user roles or groups?
Using wordpress as SSO host is not an option unfortunately
Are you using the WP Discourse plugin? If so, some functions have been added to the latest version (1.5.0) that could help you. It will be in the WordPress plugin repository later today.
The functions were added with the opposite use case in mind - restricting content on Discourse based on membership in a WordPress group, but they could be used to do what you want. I’ll write some documentation about how to use the functions later this week.
I need to make a small change to the get_discourse_user function that has been added. It’s currently not returning the groups data. I can add a parameter to it so that it returns all the data that is available for the user. That will be in the next update - sometime later this week.