You are here

function og_rules_action_audience_add_group in Organic groups 6.2

Action: add group to audience of content.

File

includes/og.rules.inc, line 153
Rules integration for the og module.

Code

function og_rules_action_audience_add_group($node, $group) {
  if (og_is_group_post_type($node->type)) {
    if (!is_array($node->og_groups)) {
      $node->og_groups = array();
    }

    // Newly created groups may have null nid.
    if ($group->nid) {
      $node->og_groups[$group->nid] = $group->nid;
    }
  }
  return array(
    'node' => $node,
  );
}