WordPress.org

Make WordPress Core

Changes between Initial Version and Version 52 of Ticket #12718


Ignore:
Timestamp:
07/21/2012 12:48:14 PM (7 years ago)
Author:
scribu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12718

    • Property Status changed from new to reopened
    • Property Cc mikeschinkel@… jltallon WordPress@… 24-7@… duck_ marty@… added
    • Property Component changed from General to Plugins
    • Property Summary changed from Better structure for admin $menu to Better structure for admin menu
    • Property Keywords has-patch dev-feedback added
    • Property Milestone changed from Awaiting Triage to 3.5
  • Ticket #12718 – Description

    initial v52  
    1010}}}
    1111
    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.
     12To 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. 
    1313
    14 It's very low level.
     14Also, we use arbitrary numeric indexes to specify the order of the items, instead of being able to position items relative to one another.
    1515
    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.
     16It's all very low level. Things would be a lot easier if we had an actual API for manipulating the menu items.