Skip to content

Instantly share code, notes, and snippets.

@ogredude
Created July 31, 2012 18:19
Show Gist options
  • Save ogredude/3219174 to your computer and use it in GitHub Desktop.
Save ogredude/3219174 to your computer and use it in GitHub Desktop.
$tid = 1;
if (arg(0) == 'node' && is_numeric(arg(1))) {
$node = node_load(arg(1));
if(array_key_exists('und', $node->field_department)) {
$tid = $node->field_department['und'][0]['tid'];
}
}
return $tid;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment