You are here

function og_remove_group_action in Organic groups 6

Same name and namespace in other branches
  1. 6.2 modules/og_actions/og_actions.module \og_remove_group_action()

A configurable action to remove a node from a specific group in og. Requires actions.module

File

modules/og_actions/og_actions.module, line 176

Code

function og_remove_group_action($node, $context) {
  if (isset($context['group'])) {
    foreach ($node->og_groups as $key => $gid) {
      if ($gid == $context['group']) {
        unset($node->og_groups[$key]);
      }
    }
    watchdog('action', 'Removed node id %id from %group.', array(
      '%id' => intval($node->nid),
      '%group' => $context['group'],
    ));
  }
}