Fix links for submenus that have real parents when a submenu with admin.php as a parent is current. see #7948
git-svn-id: http://svn.automattic.com/wordpress/trunk@9286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5e2544ac20
commit
4c6b2b6cd3
|
@ -103,7 +103,10 @@ function _wp_menu_output( &$menu, &$submenu, $submenu_as_parent = true ) {
|
||||||
|
|
||||||
if ( file_exists(WP_PLUGIN_DIR . "/{$sub_item[2]}") || ! empty($menu_hook) ) {
|
if ( file_exists(WP_PLUGIN_DIR . "/{$sub_item[2]}") || ! empty($menu_hook) ) {
|
||||||
// If admin.php is the current page or if the parent exists as a file in the plugins or admin dir
|
// If admin.php is the current page or if the parent exists as a file in the plugins or admin dir
|
||||||
if ( 'admin.php' == $pagenow || ( (!file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) && !file_exists($item[2])) )
|
$parent_exists = (file_exists(WP_PLUGIN_DIR . "/{$item[2]}") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($item[2]);
|
||||||
|
if ( $parent_exists )
|
||||||
|
echo "<li$class><a href='{$item[2]}?page={$sub_item[2]}'$class>{$sub_item[0]}</a></li>";
|
||||||
|
elseif ( 'admin.php' == $pagenow || !$parent_exists )
|
||||||
echo "<li$class><a href='admin.php?page={$sub_item[2]}'$class>{$sub_item[0]}</a></li>";
|
echo "<li$class><a href='admin.php?page={$sub_item[2]}'$class>{$sub_item[0]}</a></li>";
|
||||||
else
|
else
|
||||||
echo "<li$class><a href='{$item[2]}?page={$sub_item[2]}'$class>{$sub_item[0]}</a></li>";
|
echo "<li$class><a href='{$item[2]}?page={$sub_item[2]}'$class>{$sub_item[0]}</a></li>";
|
||||||
|
|
Loading…
Reference in New Issue