Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
coding-topic
How to add a user and group membership using API?
Avatar
ernohannink
Doetinchem, Netherlands
Member
Free Members
sp_UserOfflineSmall Offline
May 11, 2012 - 2:09 am

We are busy connecting a payment method to WordPress/Simple:Press. This will automatically add a user to WordPress after succesfull payment.

Is it possible using API to add a user to Simple:Press and a specific forum group? If so, how?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 11, 2012 - 8:08 am

absolutely... we work great with most membership plugins that follow the wp api when adding users...  if the plugin or your code maps the user to a wp role when they pay/register (like most membership plugins do) you can auto map them to an sp usergroup then where they will get specific permissions...

you do the wp role to sp usergroup mapping on forum - options - member settings...

if your code/plugin does not follow the wp api, we can still give you a function to call that will add them to the desired usergroup...  it would be:

sp_add_membership($usergroup_id, $user_id);

you can get the usergroup id from forum - usergroups - manage usergroups and of course you will need to know the wp user ID of the user you just created...

also see:  http://codex.simple-press.com/.....ip-plugin/

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626