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
This commit is contained in:
parent
4c6b2b6cd3
commit
c157d8861a
|
@ -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