Hello everyone, I come for help, I’m a little stuck with this group management
I get that the code is incomplete but it should be enough to add users into the Discourse groups, I wanted to test it a little bit before adding other hooks if needed. So far, nothing is syncing, here is my config (sorry, it’s in french in the screenshots)
Paid Membership Pro
Groups in Discourse
So, id1 in PMPro should sync with Discourse group “gratuit”, id2 with “abonnes” and id3 with “entreprises”
Part of the code that I needed to edit (the rest don’t need any change if i’m correct)
// Allows you to call the wp-discourse functions without having to write the namespace each time you use them.
use WPDiscourse\Utilities\Utilities as DiscourseUtilities;
// Returns the Discourse group name that is associated with a membership id. With
// PaidMembershipsPro, you can see the membership id on the Membership Levels page. With other
// membership plugins, you may need to call a function to get access to a `membership_id/membership_name` array.
function dcpmp_get_level_for_id( $id ) {
$levels_to_discourse_groups = array(
1 => 'gratuit',
2 => 'abonnes',
3 => 'entreprises'
);
(...)
I didn’t do any mistake I guess
I have a few (dumb) questions to be sure :
-
I have a edit the functions.php file located in
wp-includes\
and insert the code in the end of the file, right ? -
For the discourse groups, is it the name (all lowercase) or the Full Name we have to use in the functions.php ?
I’ll use an example, for the id2 <=> abonnes, here is the Discourse group config :
I’m supposed to use abonnes instead of Abonnés, right ?
-
Do I need to do something specific to trigger the syncing ? I tried to create a new member in the paid membership pro, logout/login to Discourse, without success
-
Do I need to configure a webhook in the WP DIscourse plugin ? I was thinking of Update Userdata, but when I tried it, nothing happened
I tried to create two news groups, walking and running to follow the example, I didn’t work either so, it probably comes from one stupid mistake on my part. If anyone have a clue, I’ll take it.
Anyway, the wordpress plugin is really impressive, even with little knowledge on wordpress it’s really easy to configure