Opened 19 months ago
Last modified 19 months ago
#19206 new defect (bug)
Improve internal admin menu code
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Administration | Version: | 3.3 |
| Severity: | normal | Keywords: | 3.4-early has-patch |
| Cc: | xoodrew@…, info@… |
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 (6)
koopersmith — 19 months ago
koopersmith — 19 months ago
comment:1
koopersmith — 19 months ago
comment:2
DrewAPicture — 19 months ago
- Cc xoodrew@… added
- 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?
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.