3

I have found many examples about how to add a user to an organic group but I can't find any info on how to remove a user from an organic group programmatically. Does anyone have an example of how to do this?

1 Answer 1

4

Part of me thinks that og_membership_delete would be a good option, you can pass the entity ID in as a parameter (and by "can", I really mean "need to"). Also, og_ungroup seems useful as well.

You can find more functions that OG defines at: http://www.drupalcontrib.org/api/drupal/contributions!og!og.module/7

Here's an example of og_ungroup:

og_ungroup('node', $gid, 'user', $uid);
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.