Changeset 9337
- Timestamp:
- 10/24/2008 10:40:19 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/menu-header.php
r9306 r9337 37 37 // 0 = name, 1 = capability, 2 = file, 3 = class, 4 = id, 5 = icon src 38 38 foreach ( $menu as $key => $item ) { 39 $admin_is_parent = false; 39 40 $class = array(); 40 41 if ( $first ) { … … 67 68 $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. 68 69 $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); 69 if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) 70 if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) { 71 $admin_is_parent = true; 70 72 echo "$img$toggle<a href='admin.php?page={$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>"; 71 else73 } else { 72 74 echo "\n\t$img$toggle<a href='{$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>"; 75 } 73 76 } else if ( current_user_can($item[1]) ) { 74 77 $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); 75 78 if ( file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || !empty($menu_hook) ) { 79 $admin_is_parent = true; 76 80 echo "\n\t$img$toggle<a href='admin.php?page={$item[2]}'$class>{$item[0]}</a>"; 77 81 } else { … … 107 111 if ( file_exists(WP_PLUGIN_DIR . "/{$sub_item[2]}") || ! empty($menu_hook) ) { 108 112 // If admin.php is the current page or if the parent exists as a file in the plugins or admin dir 109 $parent_exists = ( file_exists(WP_PLUGIN_DIR . "/{$item[2]}") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($item[2]);113 $parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/{$item[2]}") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($item[2]); 110 114 if ( $parent_exists ) 111 115 echo "<li$class><a href='{$item[2]}?page={$sub_item[2]}'$class>{$sub_item[0]}</a></li>";
Note: See TracChangeset
for help on using the changeset viewer.