The links for hook_link() take the following format:

$links['name of link']['#attribute'] = ....

One might suspect a Forms API-like abstraction where you can mix attributes and elements at arbitrary levels of recursion. This is not true. The attributes are always on the second level, the link keys are always on the first level. So, the #-sign is redundant as attribute names do not share a namespace with anything else.

The attached patch removes them. I also added a check_plain() when printing the 'title' attribute for non-links, to make it consistent with the link version.

CommentFileSizeAuthor
links.hash.patch16.95 KBSteven
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chx’s picture

Status: Needs review » Reviewed & tested by the community

When the final version of hook_links was created we were all in crazy about the shiny new form API (only half a year in making ;) ). But Steven is right.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)