diff --git a/wp-admin/menu-header.php b/wp-admin/menu-header.php index fd58e1184..b3b2e8644 100644 --- a/wp-admin/menu-header.php +++ b/wp-admin/menu-header.php @@ -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 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 "{$sub_item[0]}"; + elseif ( 'admin.php' == $pagenow || !$parent_exists ) echo "{$sub_item[0]}"; else echo "{$sub_item[0]}";