forum_link_alter

Definition

forum_link_alter(&$node, &$links)
forum/forum.module, line 647

Code

<?php
function forum_link_alter(&$node, &$links) {
  foreach ($links as $module => $link) {
    if (strstr($module, 'taxonomy_term')) {
      // Link back to the forum and not the taxonomy term page. We'll only
      // do this if the taxonomy term in question belongs to forums.
      $tid = str_replace('taxonomy/term/', '', $link['href']);
      $term = taxonomy_get_term($tid);
      if ($term->vid == _forum_get_vid()) {
        $links[$module]['href'] = str_replace('taxonomy/term', 'forum', $link['href']);
      }
    }
  }
}
?>