Changes from trunk/wp-admin/menu-header.php at r11118 to branches/2.8/wp-admin/menu-header.php at r11583
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.8/wp-admin/menu-header.php
r11118 r11583 75 75 $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. 76 76 $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); 77 if ( ( ('index.php' != $submenu[$item[2]][0][2]) && file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") ) || !empty($menu_hook)) { 77 $menu_file = $submenu[$item[2]][0][2]; 78 if ( false !== $pos = strpos($menu_file, '?') ) 79 $menu_file = substr($menu_file, 0, $pos); 80 if ( ( ('index.php' != $submenu[$item[2]][0][2]) && file_exists(WP_PLUGIN_DIR . "/$menu_file") ) || !empty($menu_hook)) { 78 81 $admin_is_parent = true; 79 82 echo "<div class='wp-menu-image'><a href='admin.php?page={$submenu[$item[2]][0][2]}'>$img</a></div>$toggle<a href='admin.php?page={$submenu[$item[2]][0][2]}'$class$tabindex>{$item[0]}</a>"; … … 83 86 } else if ( current_user_can($item[1]) ) { 84 87 $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); 85 if ( ('index.php' != $item[2]) && file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || !empty($menu_hook) ) { 88 $menu_file = $item[2]; 89 if ( false !== $pos = strpos($menu_file, '?') ) 90 $menu_file = substr($menu_file, 0, $pos); 91 if ( ('index.php' != $item[2]) && file_exists(WP_PLUGIN_DIR . "/$menu_file") || !empty($menu_hook) ) { 86 92 $admin_is_parent = true; 87 93 echo "\n\t<div class='wp-menu-image'><a href='admin.php?page={$item[2]}'>$img</a></div>$toggle<a href='admin.php?page={$item[2]}'$class$tabindex>{$item[0]}</a>"; … … 103 109 $first = false; 104 110 } 111 112 $menu_file = $item[2]; 113 if ( false !== $pos = strpos($menu_file, '?') ) 114 $menu_file = substr($menu_file, 0, $pos); 115 105 116 if ( isset($submenu_file) ) { 106 117 if ( $submenu_file == $sub_item[2] ) … … 108 119 // If plugin_page is set the parent must either match the current page or not physically exist. 109 120 // This allows plugin pages with the same hook to exist under different parents. 110 } else if ( (isset($plugin_page) && $plugin_page == $sub_item[2] && (!file_exists($ item[2]) || ($item[2] == $self))) || (!isset($plugin_page) && $self == $sub_item[2]) ) {121 } else if ( (isset($plugin_page) && $plugin_page == $sub_item[2] && (!file_exists($menu_file) || ($item[2] == $self))) || (!isset($plugin_page) && $self == $sub_item[2]) ) { 111 122 $class[] = 'current'; 112 123 } … … 115 126 116 127 $menu_hook = get_plugin_page_hook($sub_item[2], $item[2]); 128 $sub_file = $sub_item[2]; 129 if ( false !== $pos = strpos($sub_file, '?') ) 130 $sub_file = substr($sub_file, 0, $pos); 117 131 118 if ( ( ('index.php' != $sub_item[2]) && file_exists(WP_PLUGIN_DIR . "/ {$sub_item[2]}") ) || ! empty($menu_hook) ) {132 if ( ( ('index.php' != $sub_item[2]) && file_exists(WP_PLUGIN_DIR . "/$sub_file") ) || ! empty($menu_hook) ) { 119 133 // If admin.php is the current page or if the parent exists as a file in the plugins or admin dir 120 $parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/{$item[2]}") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($item[2]); 134 135 $parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/$menu_file") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($menu_file); 121 136 if ( $parent_exists ) 122 137 echo "<li$class><a href='{$item[2]}?page={$sub_item[2]}'$class$tabindex>{$sub_item[0]}</a></li>";
Note: See TracChangeset
for help on using the changeset viewer.