Opened 13 years ago
Closed 10 years ago
#19206 closed defect (bug) (duplicate)
Improve internal admin menu code
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.3 |
Component: | Administration | Keywords: | needs-refresh |
Focuses: | Cc: |
Description
The internal admin menu code is both hard to read and filled with several unnecessary branches. This makes maintaining the code quite difficult.
A few uses of list and smarter branching can considerably improve _wp_menu_output. Patch attached. Let's revisit this when we branch for 3.4.
Attachments (2)
Change History (8)
#3
follow-up:
↓ 4
@
13 years ago
- Cc info@… added
I would really love to see the native nav menu code reused. It should be possible to use a custom walker to create the admin menu (and the admin bar). This would reduce the learning curve and the code base. Maybe in 3.4?
#4
in reply to:
↑ 3
@
13 years ago
Replying to toscho:
I would really love to see the native nav menu code reused. It should be possible to use a custom walker to create the admin menu (and the admin bar). This would reduce the learning curve and the code base. Maybe in 3.4?
That's been proposed before but it feels incredibly hacky. I wouldn't mind implementing this as a walker, though. The current admin menu code -- menu.php x 4, menu-header.php, etc. -- is definitely the worst code in WordPress at the moment.
I've attached both a diff and a copy of the function to make updating the diff less difficult.