You are here

function og_context_og_invalidate_cache in Organic groups 7.2

Same name and namespace in other branches
  1. 7 og_context/og_context.module \og_context_og_invalidate_cache()

Implements hook_og_invalidate_cache().

File

og_context/og_context.module, line 164
Get a group from a viewed page.

Code

function og_context_og_invalidate_cache($gids = array()) {
  $caches = array(
    'og_context',
    'og_context_js',
  );
  foreach ($caches as $cache) {
    drupal_static_reset($cache);
  }
  if ($gids && !empty($_SESSION['og_context']) && in_array($_SESSION['og_context'], $gids)) {

    // Remove group's context.
    $_SESSION['og_context'] = NULL;
  }
}