Inicio › API reference ›
hook_link_alter
hooks/core.php, line 967
- Versions
- hooks
hook_link_alter(&$links, $node)
Perform alterations before links on a node are rendered.
One popular use of this hook is to add/delete links from other modules.
Parameters
$links Nested array of links for the node keyed by providing module.
$node A node object that contains the links.
Valor de retorno
None.
Código
<?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']);
}
}
}
?> 
Comentarios recientes
hace 17 horas 50 mins
hace 1 día 10 horas
hace 1 semana 21 horas
hace 14 semanas 4 días
hace 19 semanas 19 horas
hace 20 semanas 2 días
hace 20 semanas 5 días
hace 20 semanas 5 días
hace 21 semanas 2 días
hace 22 semanas 1 día