Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
links.hash.patch | 16.95 KB | Steven | |
Comments
Comment #1
chx CreditAttribution: chx commentedWhen 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.
Comment #2
drummCommitted to HEAD.
Comment #3
(not verified) CreditAttribution: commented