[wp-trac] [WordPress Trac] #2610: New menu privelege code messes up
plugins using globals
WordPress Trac
wp-trac at lists.automattic.com
Thu Mar 30 20:40:27 GMT 2006
#2610: New menu privelege code messes up plugins using globals
----------------------------+-----------------------------------------------
Id: 2610 | Status: new
Component: Administration | Modified: Thu Mar 30 20:40:27 2006
Severity: normal | Milestone:
Priority: normal | Version: 2.1
Owner: anonymous | Reporter: ryanscheuermann
----------------------------+-----------------------------------------------
In '''menu.php''', the loops that recreate the menus based on permissions
are called before the action "admin_menu" is called.
So any menus or submenus added by plugins aren't removed with the loops.
Also, this causes problems when any plugins directly modify the global
arrays $menu or $submenu using the original parent as a key.
Proposed fix: just moved the call to
{{{
do_action('admin_menu', '');
}}}
above the permission loops.
Also, submenus are not sorted by calling
{{{
ksort($menu); // make it all pretty
}}}
for my own sanity, please change to:
{{{
ksort($menu); // make it all pretty
foreach($submenu as $key => $menu_item)
{
ksort($menu_item);
$submenu[$key] = $menu_item;
}
}}}
And I know that plugins are supposed to use the add_submenu_page, but that
function contains no method of indicating the sort number for the menus.
What's the point of using ksort if plugins can't add menu items where they
want?
Thanks!
--
Ticket URL: <http://trac.wordpress.org/ticket/2610>
WordPress Trac <http://wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list