Changes between Initial Version and Version 52 of Ticket #12718
- Timestamp:
- 07/21/2012 12:48:14 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #12718
-
Property
Status
changed from
newtoreopened - Property Cc mikeschinkel@… jltallon WordPress@… 24-7@… duck_ marty@… added
-
Property
Component
changed from
GeneraltoPlugins -
Property
Summary
changed from
Better structure for admin $menutoBetter structure for admin menu - Property Keywords has-patch dev-feedback added
-
Property
Milestone
changed from
Awaiting Triageto3.5
-
Property
Status
changed from
-
Ticket #12718 – Description
initial v52 10 10 }}} 11 11 12 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. 12 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. 13 13 14 It's very low level.14 Also, we use arbitrary numeric indexes to specify the order of the items, instead of being able to position items relative to one another. 15 15 16 Things would be a lot easier if groups were built in: 17 18 {{{ 19 $menu = array( 20 'dashboard' => array( 21 [5] => array('Dashboard', ... 22 ), 23 24 'object' => array( 25 [5] => array('Posts', ...) 26 [10] => array('Media', ...) 27 ... 28 ), 29 30 'utility' => array( 31 [5] => array('Posts', ...) 32 [10] => array('Media', ...) 33 ... 34 ), 35 ) 36 }}} 37 38 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. 16 It's all very low level. Things would be a lot easier if we had an actual API for manipulating the menu items.