[wp-trac] [WordPress Trac] #12718: Better structure for admin $menu

WordPress Trac wp-trac at lists.automattic.com
Thu Sep 30 10:25:47 UTC 2010


#12718: Better structure for admin $menu
-------------------------+--------------------------------------------------
 Reporter:  scribu       |       Owner:                 
     Type:  enhancement  |      Status:  assigned       
 Priority:  normal       |   Milestone:  Awaiting Triage
Component:  Plugins      |     Version:                 
 Severity:  normal       |    Keywords:                 
-------------------------+--------------------------------------------------

Comment(by scribu):

 Ah, another "wonderful" thing about PHP4: objects are not passed by
 reference, but are cloned. That's why we have add_action_ref_array().

 I think we should either:

  * add a big warning in the docs, signaling that this doesn't work
 properly in PHP4
  * punt to WP 3.2 and only commit #14666 in 3.1

 > Also, I used the terms "Menu Section" and "Menu Item" because AFAICT
 there hasn't been consistent naming and the names that have been used are
 unclear (at least to me.) If there are terms that others would prefer, I
 can change.

 We do have a naming convention:

 {{{
 menu: a top-level item
 submenu: an item inside a menu
 }}}

 Also, we generally use 'delete' when it's related to user data, like posts
 and comments. We use 'remove' for everything else: remove_action(),
 remove_theme_support() etc.

 So, delete_admin_menu_section() would become remove_admin_menu() and
 delete_admin_menu_item() would be remove_admin_submenu().

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12718#comment:23>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list