Fix links for submenus added to existing menus. see #7948

git-svn-id: https://develop.svn.wordpress.org/trunk@9285 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-10-22 20:33:59 +00:00
parent f2f9e897b8
commit daaedd9c91

View File

@ -102,7 +102,8 @@ function _wp_menu_output( &$menu, &$submenu, $submenu_as_parent = true ) {
$menu_hook = get_plugin_page_hook($sub_item[2], $item[2]); $menu_hook = get_plugin_page_hook($sub_item[2], $item[2]);
if ( file_exists(WP_PLUGIN_DIR . "/{$sub_item[2]}") || ! empty($menu_hook) ) { if ( file_exists(WP_PLUGIN_DIR . "/{$sub_item[2]}") || ! empty($menu_hook) ) {
if ( 'admin.php' == $pagenow || !file_exists(WP_PLUGIN_DIR . "/$parent_file") ) // If admin.php is the current page or if the parent exists as a file in the plugins or admin dir
if ( 'admin.php' == $pagenow || ( (!file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) && !file_exists($item[2])) )
echo "<li$class><a href='admin.php?page={$sub_item[2]}'$class>{$sub_item[0]}</a></li>"; echo "<li$class><a href='admin.php?page={$sub_item[2]}'$class>{$sub_item[0]}</a></li>";
else else
echo "<li$class><a href='{$item[2]}?page={$sub_item[2]}'$class>{$sub_item[0]}</a></li>"; echo "<li$class><a href='{$item[2]}?page={$sub_item[2]}'$class>{$sub_item[0]}</a></li>";