hook_link_alter

  1. drupal
    1. drupal6 core.php
    2. drupal7
Versionen
drupal6 hook_link_alter(&$links, $node, $comment = NULL)
drupal7 hook_link_alter(array &$links, $node)

Perform alterations before links on a comment are rendered. One popular use of this hook is to modify/remove links from other modules. If you want to add a link to the links section of a node, use hook_link instead.

Übergabeparameter

$links Nested array of links for the node keyed by providing module.

$node A node object that contains the links.

Rückgabewert

None.

Verwandte Themen

Code

modules/system/system.api.php, line 470

<?php
function hook_link_alter(array &$links, $node) {
  foreach ($links as $module => $link) {
    if (strpos($module, 'taxonomy_term') !== FALSE) {
      // Link back to the forum and not the taxonomy term page
      $links[$module]['href'] = str_replace('taxonomy/term', 'forum', $link['href']);
    }
  }
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen