From daaedd9c91264a13b7ef88e66d4ddb04284366d1 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 22 Oct 2008 20:33:59 +0000 Subject: [PATCH] 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 --- wp-admin/menu-header.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-admin/menu-header.php b/wp-admin/menu-header.php index 83b90ad4db..fd58e11845 100644 --- a/wp-admin/menu-header.php +++ b/wp-admin/menu-header.php @@ -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]); 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 "{$sub_item[0]}"; else echo "{$sub_item[0]}";