[wp-trac] Re: [WordPress Trac] #5427: WordPress should not include a file indicated by a URL query string that has not been specified in an add_submenu_page call

WordPress Trac wp-trac at lists.automattic.com
Sat Feb 9 18:50:30 GMT 2008


#5427: WordPress should not include a file indicated by a URL query string that
has not been specified in an add_submenu_page call
----------------------------------------+-----------------------------------
 Reporter:  johnbillion                 |        Owner:  anonymous
     Type:  defect                      |       Status:  new      
 Priority:  normal                      |    Milestone:  2.6      
Component:  Administration              |      Version:  2.3.1    
 Severity:  normal                      |   Resolution:           
 Keywords:  add_submenu_page has-patch  |  
----------------------------------------+-----------------------------------
Comment (by darkdragon):

 Is it possible to optimize the loops by using {{{in_array()}}} and/or
 {{{array_search()}}}?

 It appears the top menu search is basically duplicating {{{in_array()}}}.
 I'm unsure about the second. It is okay, since you most likely won't be
 able to use in_array() unless you know the top level menu item. I think
 iterating through the top menu and then using in_array() to prevent
 looping on the sub menu will work.

 Just a suggestion, however, it is unlikely to matter since most admin
 menus are not going to have 100s or even thousands of items. Might be
 premature optimization, but I think the coding part would justify the
 change. The testing part, I'm not so sure of.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5427#comment:2>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list