Opened 3 years ago
Last modified 8 days ago
#12718 reopened enhancement
Better structure for admin $menu — at Initial Version
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Plugins | Version: | |
| Severity: | normal | Keywords: | has-patch dev-feedback |
| Cc: | mikeschinkel@…, jltallon, WordPress@…, 24-7@…, duck_, marty@…, georgemamadashvili@…, xoodrew@…, contact@…, bob.ellison@…, whiteshadow@… |
Description
Currently, the global $menu variable is one big linear array:
$menu = array(
[2] => array('Dashboard', ...
[4] => array('', 'read', 'separator1', ...),
[5] => array('Posts', ...)
...
)
To allow plugins to add a menu item at the end of a group, we use a bunch of additional global variables that remember the last element in each group.
It's very low level.
Things would be a lot easier if groups were built in:
$menu = array(
'dashboard' => array(
[5] => array('Dashboard', ...
),
'object' => array(
[5] => array('Posts', ...)
[10] => array('Media', ...)
...
),
'utility' => array(
[5] => array('Posts', ...)
[10] => array('Media', ...)
...
),
)
With this structure, separators could be inserted automatically in the right places. Also, you wouldn't have to worry about adding 'menu-top-first' and 'menu-top-last' classes.
Note: See
TracTickets for help on using
tickets.
