Check menu privs after plugins add their menus. fixes #2696

git-svn-id: https://develop.svn.wordpress.org/trunk@3756 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-05-02 19:08:37 +00:00
parent a3dddd0802
commit f558a75316
1 changed files with 7 additions and 6 deletions

View File

@ -48,6 +48,13 @@ $submenu['plugins.php'][10] = array(__('Plugin Editor'), 'edit_plugins', 'plugin
$submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php');
$submenu['themes.php'][10] = array(__('Theme Editor'), 'edit_themes', 'theme-editor.php');
// Create list of page plugin hook names.
foreach ($menu as $menu_page) {
$admin_page_hooks[$menu_page[2]] = sanitize_title($menu_page[0]);
}
do_action('admin_menu', '');
// Loop over submenus and remove pages for which the user does not have privs.
foreach ($submenu as $parent => $sub) {
foreach ($sub as $index => $data) {
@ -93,12 +100,6 @@ foreach ( $menu as $id => $data ) {
}
}
// Create list of page plugin hook names.
foreach ($menu as $menu_page) {
$admin_page_hooks[$menu_page[2]] = sanitize_title($menu_page[0]);
}
do_action('admin_menu', '');
ksort($menu); // make it all pretty
if (! user_can_access_admin_page()) {