diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 64201b385b..8801e89b83 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -639,17 +639,12 @@ function parent_dropdown($default = 0, $parent = 0, $level = 0) { } function user_can_access_admin_page() { - global $parent_file; global $pagenow; global $menu; global $submenu; global $user_level; - if (! isset($parent_file)) { - $parent = $pagenow; - } else { - $parent = $parent_file; - } + $parent = get_admin_page_parent(); foreach ($menu as $menu_array) { //echo "parent array: " . $menu_array[2]; diff --git a/wp-admin/menu.php b/wp-admin/menu.php index 9e78cd0c78..0aec209a4a 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -8,7 +8,7 @@ $menu[0] = array(__('Dashboard'), 0, 'index.php'); $menu[5] = array(__('Write'), 1, 'post.php'); $menu[10] = array(__('Manage'), 1, 'edit.php'); $menu[20] = array(__('Links'), 5, 'link-manager.php'); -$menu[25] = array(__('Users'), 3, 'users.php'); +$menu[25] = array(__('Users'), 0, 'profile.php'); $menu[30] = array(__('Options'), 6, 'options-general.php'); $menu[35] = array(__('Plugins'), 8, 'plugins.php'); $menu[40] = array(__('Presentation'), 8, 'themes.php'); @@ -23,28 +23,28 @@ $submenu['edit.php'][15] = array(__('Categories'), 1, 'categories.php'); $submenu['edit.php'][20] = array(__('Comments'), 1, 'edit-comments.php'); $awaiting_mod = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'"); $submenu['edit.php'][25] = array(sprintf(__("Awaiting Moderation (%s)"), $awaiting_mod), 1, 'moderation.php'); -$submenu['edit.php'][30] = array(__('Files'), 5, 'templates.php'); +$submenu['edit.php'][30] = array(__('Files'), 8, 'templates.php'); $submenu['link-manager.php'][5] = array(__('Manage Links'), 5, 'link-manager.php'); $submenu['link-manager.php'][10] = array(__('Add Link'), 5, 'link-add.php'); $submenu['link-manager.php'][15] = array(__('Link Categories'), 5, 'link-categories.php'); $submenu['link-manager.php'][20] = array(__('Import Links'), 5, 'link-import.php'); -$submenu['users.php'][5] = array(__('Authors & Users'), 5, 'users.php'); -$submenu['users.php'][10] = array(__('Your Profile'), 5, 'profile.php'); +$submenu['users.php'][5] = array(__('Your Profile'), 0, 'profile.php'); +$submenu['users.php'][10] = array(__('Authors & Users'), 5, 'users.php'); -$submenu['options-general.php'][5] = array(__('General'), 5, 'options-general.php'); -$submenu['options-general.php'][10] = array(__('Writing'), 5, 'options-writing.php'); -$submenu['options-general.php'][15] = array(__('Reading'), 5, 'options-reading.php'); -$submenu['options-general.php'][20] = array(__('Discussion'), 5, 'options-discussion.php'); -$submenu['options-general.php'][25] = array(__('Permalinks'), 5, 'options-permalink.php'); -$submenu['options-general.php'][30] = array(__('Miscellaneous'), 5, 'options-misc.php'); +$submenu['options-general.php'][5] = array(__('General'), 6, 'options-general.php'); +$submenu['options-general.php'][10] = array(__('Writing'), 6, 'options-writing.php'); +$submenu['options-general.php'][15] = array(__('Reading'), 6, 'options-reading.php'); +$submenu['options-general.php'][20] = array(__('Discussion'), 6, 'options-discussion.php'); +$submenu['options-general.php'][25] = array(__('Permalinks'), 6, 'options-permalink.php'); +$submenu['options-general.php'][30] = array(__('Miscellaneous'), 6, 'options-misc.php'); -$submenu['plugins.php'][5] = array(__('Plugins'), 5, 'plugins.php'); -$submenu['plugins.php'][10] = array(__('Plugin Editor'), 5, 'plugin-editor.php'); +$submenu['plugins.php'][5] = array(__('Plugins'), 8, 'plugins.php'); +$submenu['plugins.php'][10] = array(__('Plugin Editor'), 8, 'plugin-editor.php'); -$submenu['themes.php'][5] = array(__('Themes'), 5, 'themes.php'); -$submenu['themes.php'][10] = array(__('Theme Editor'), 5, 'theme-editor.php'); +$submenu['themes.php'][5] = array(__('Themes'), 8, 'themes.php'); +$submenu['themes.php'][10] = array(__('Theme Editor'), 8, 'theme-editor.php'); do_action('admin_menu', ''); ksort($menu); // make it all pretty diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php index dd4fb09cbc..6aa8897429 100644 --- a/wp-admin/user-edit.php +++ b/wp-admin/user-edit.php @@ -83,8 +83,8 @@ $edituser = get_userdata($user_id); if ($edituser->user_level >= $user_level) die( __('You do not have permission to edit this user.') ); ?>