[buddypress-dev] [BuddyPress] How to programmatically add an user to a group

Pasquale Puzio pasquale.puzio at gmail.com
Mon Jun 27 15:34:41 UTC 2011


Thank you very much Stas, using your snippet I've solved the problem! :-)

2011/6/27 Stas Sușcov <stas at nerd.ro>:
> În data de Lu, 27-06-2011 la 09:12 +0200, Pasquale Puzio a scris:
>> Hi friends,
>>
>> I would know if in BuddyPress there is some function or some plugin
>> that allow me to automatically add an user to a group. I need that
>> because it's an important function of my work-flow.
>>
>> If there aren't, could someone post here a sample code to do that?
>>
>> Thanks
>
> Hey,
> you should take a look at `groups_join_group()` and
> `groups_leave_group()`
>
> Here's a snippet that should help you:
> http://chopapp.com/#yqf6vusa
>
>
> _______________________________________________
> buddypress-dev mailing list
> buddypress-dev at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/buddypress-dev
>



-- 
Dott. Pasquale Puzio
http://www.pasqualepuzio.it
info at pasqualepuzio.it
340 5026359


More information about the buddypress-dev mailing list