From 89440182ee3962a39e53140c517c11a06d25cb76 Mon Sep 17 00:00:00 2001 From: Ryan Boren 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: https://develop.svn.wordpress.org/trunk@9287 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 b3b2e86440..3888f012d7 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'; }