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'; }