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

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 28 12:01:57 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 mikeschinkel):

 Replying to [comment:14 scribu]:
 > I think we should just use slugs. Indexes are what we're trying to get
 away from and titles are translatable.

 Good point about indexes.  When writing code for my own use they made
 sense, but as a potential inclusion into core I agree they  probably
 aren't needed.

 > As such, you wouldn't need the third parameter for
 delete_admin_menu_item().

 Agree.

 That said, I'd hate to loose the titles even though translatable.

 I'd expect 85% of use for this would be people developing custom themes
 for a specific client so they only ever have to test with one site, and
 15% for use in commercial themes plugins.  For plugins I think the slugs
 make much better sense but for the average theme developer I know it took
 me a while to wrap my head around how the slugs were used so I think the
 ease of use of titles would have a huge "usability" benefit.

 For the titles we can of course test against the translated version too.

 So for those who barely know what they are doing they can use the easy way
 with titles and those who know what they are doing can use the more robust
 and performant way with slugs. This could easily be documented as 1.) the
 easy way for single sites or 2.) the robust way for commercial themes and
 plugins, and we don't need the 3rd parameter because we can do a case-
 sensitive comparison for slug first then for title.

 If you agree I can give it a go later today and refactor to simplify the
 code.  Also, do you see other functions to implement?

 -Mike

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


More information about the wp-trac mailing list