Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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