You are here

function og_views_query_substitutions in Organic groups 5

Same name and namespace in other branches
  1. 5.8 og_views.inc \og_views_query_substitutions()
  2. 5.3 og_views.inc \og_views_query_substitutions()
  3. 5.7 og_views.inc \og_views_query_substitutions()
  4. 6.2 modules/og_views/og_views.views.inc \og_views_query_substitutions()
  5. 6 modules/og_views/og_views.views.inc \og_views_query_substitutions()

Allow replacement of current group so we can cache these queries.

File

./og_views.inc, line 1422

Code

function og_views_query_substitutions($view) {
  $groupnode = og_get_group_context();

  // return -1 instead of 0 to avoid matching all posts without a group
  return array(
    '***CURRENT_GID***' => $groupnode ? $groupnode->nid : -1,
  );
}