Opened 17 years ago
Closed 15 years ago
#4701 closed enhancement (worksforme)
ID attribute for adminmenu items
Reported by: | leonid | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | |
Focuses: | Cc: |
Description
Administration menu customizations are very limited right now (think: icons for menu items), partially due to the fact that menu items don't have ID attributes. The attached patch (against trunk r5844) generates ID attributes using sanitize_title(). The resulting values look like "adminmenu_dashboard" and "submenu_write-post".
There was a preliminary OK for this functionality from Matt on wp-hackers list:
http://comox.textdrive.com/pipermail/wp-hackers/2007-July/013746.html
Attachments (1)
Change History (12)
#3
@
17 years ago
item[0] is a translated string. It will change depending on the locale. I think we have to sanitize the filename or add a unique, consistent identifier to the menu arrays.
#4
@
17 years ago
I wish that part of menu-header.php was written somehow simpler. I have to drink five pints before I can make any sense of it, and I do forget it all by the next morning. :)
On the serious note, would calling sanitize_file_name($item[2]) be sufficient or is there something else to be careful about? I can redo the patch, no problem. But I really have issues understanding some of that code (a bunch of if-then-else statements with re-indexing of a heavy array).
#7
@
16 years ago
- Keywords needs-patch added; has-patch removed
This will need refreshing. I'm sure I saw a newer version of this ticket with respect to the 2.7 menu area, but now I can't find it. Otherwise I'd close this off as a dupe.
Patch wp-admin/menu-header.php to have ID attributes for admin menu