Calling all Drupal developers!
Help us get this on the first page of Digg. DIGG NOW!
Help us get this on the first page of Digg. DIGG NOW!
hook_link_alter(&$links, $node)
documentation/hooks/core.php, line 925
Perform alterations before links on a node are rendered. One popular use of this hook is to add/delete links from other modules.
$links Nested array of links for the node
$node A node object for editing links on
None.
| Name | Description |
|---|---|
| Hooks | Allow modules to interact with the Drupal core. |
<?php
function hook_link_alter(&$links, $node) {
foreach ($links AS $module => $link) {
if (strstr($module, 'taxonomy_term')) {
// Link back to the forum and not the taxonomy term page
$links[$module]['#href'] = str_replace('taxonomy/term', 'forum', $link['#href']);
}
}
}
?>