you can use the function
bbp_set_user_role( $user_id, $new_role)
$new_role will need bbp_ in front eg bbp_keymaster, bbp_participant etc.
Thanks for the quick reply!
Okay and if it’s a custom role will that work as well? Like ‘bbp_cadet’?
Should it be “bbp_cadet” after the equals? I think I forgot that above.
(@pdidee asked about this on a slack channel, thought I would leave my solution here)
HTTP Post is basically the same thing as a form submission. Consider this example from the infusionsoft link you sent:
That is basically like having a form that is submitted to your website at the URL you choose, with the field names (left) and values (right).
Here is an example of what you should send from Infusionsoft:
contactId = ~Contact.Id~
access_key = [your access key]
bbp_action = set_role
bbp_role = cadet
When your website gets that data, nothing happens. BBPress and WordPress do not know what to do with that data you came up with. You have to make that data do something.
Here is an example that will handle that URL. It is not tested:
https://gist.github.com/RadGH/38473c6ebcda730cedadd49de1ad0348
You need to change the value of “$internal_access_key” to match your access key.
You will probably also need to change the meta key used in the WP_User_Query which I set as “infusionsoft_contact_id”. I’m guessing infusionsoft does store that data on your users, but may be under a different key. Check the infusionsoft plugin documentation and hopefully you can find it there.