Skip to content

Instantly share code, notes, and snippets.

@jcsalterego
Created April 22, 2009 16:19
Show Gist options
  • Select an option

  • Save jcsalterego/99886 to your computer and use it in GitHub Desktop.

Select an option

Save jcsalterego/99886 to your computer and use it in GitHub Desktop.
foreach ($node->taxonomy as $item) {
$parents = taxonomy_get_parents($item->tid);
$parents_used = array();
foreach ($parents as $item2) {
if ($item2->vid == 2 && !isset($parents_used[$item2->tid])) {
$parents_used[$item2->tid] = true;
}
}
var_dump(array_keys($parents_used));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment