From c157d8861af1ee9e3315598c0c7060d18692da23 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 22 Oct 2008 20:57:37 +0000 Subject: [PATCH] Fix current submenu designation when sub swith the same hook exist under different parents. fixes #7948 git-svn-id: http://svn.automattic.com/wordpress/trunk@9287 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/menu-header.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-admin/menu-header.php b/wp-admin/menu-header.php index b3b2e8644..3888f012d 100644 --- a/wp-admin/menu-header.php +++ b/wp-admin/menu-header.php @@ -93,7 +93,9 @@ function _wp_menu_output( &$menu, &$submenu, $submenu_as_parent = true ) { if ( isset($submenu_file) ) { if ( $submenu_file == $sub_item[2] ) $class[] = 'current'; - } else if ( (isset($plugin_page) && $plugin_page == $sub_item[2]) || (!isset($plugin_page) && $self == $sub_item[2]) ) { + // If plugin_page is set the parent must either match the current page or not physically exist. + // This allows plugin pages with the same hook to exist under different parents. + } else if ( (isset($plugin_page) && $plugin_page == $sub_item[2] && (!file_exists($item[2]) || ($item[2] == $self))) || (!isset($plugin_page) && $self == $sub_item[2]) ) { $class[] = 'current'; }