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
This commit is contained in:
parent
b4b522ffe3
commit
89440182ee
@ -93,7 +93,9 @@ function _wp_menu_output( &$menu, &$submenu, $submenu_as_parent = true ) {
|
|||||||
if ( isset($submenu_file) ) {
|
if ( isset($submenu_file) ) {
|
||||||
if ( $submenu_file == $sub_item[2] )
|
if ( $submenu_file == $sub_item[2] )
|
||||||
$class[] = 'current';
|
$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';
|
$class[] = 'current';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user