diff --git a/wp-admin/menu-header.php b/wp-admin/menu-header.php
index c8a2e4316c..fe04521d66 100644
--- a/wp-admin/menu-header.php
+++ b/wp-admin/menu-header.php
@@ -82,9 +82,7 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
echo "\n\t
";
- if ( false !== strpos($class, 'wp-menu-separator') ) {
- echo '
';
- } elseif ( $submenu_as_parent && !empty($submenu[$item[2]]) ) {
+ if ( $submenu_as_parent && !empty($submenu[$item[2]]) ) {
$submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index.
$menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]);
$menu_file = $submenu[$item[2]][0][2];
@@ -96,7 +94,7 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
} else {
echo "\n\t$arrow$toggle$title";
}
- } else if ( current_user_can($item[1]) ) {
+ } else if ( !empty($item[2]) && current_user_can($item[1]) ) {
$menu_hook = get_plugin_page_hook($item[2], 'admin.php');
$menu_file = $item[2];
if ( false !== $pos = strpos($menu_file, '?') )
diff --git a/wp-admin/menu.php b/wp-admin/menu.php
index bdb31d22b2..bed11d6ffd 100644
--- a/wp-admin/menu.php
+++ b/wp-admin/menu.php
@@ -69,7 +69,7 @@ if ( ! is_multisite() ) {
unset($theme_update_count, $wordpress_update_count, $update_themes, $update_plugins, $update_wordpress);
-$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
+$menu[4] = array( '', 'read', '', '', 'wp-menu-separator' );
$menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu-top menu-icon-post', 'menu-posts', 'div' );
$submenu['edit.php'][5] = array( __('All Posts'), 'edit_posts', 'edit.php' );
@@ -152,7 +152,7 @@ foreach ( (array) get_post_types( array('show_ui' => true, '_builtin' => false,
}
unset($ptype, $ptype_obj, $ptype_class, $ptype_for_id, $ptype_menu_position, $menu_icon, $i, $tax);
-$menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' );
+$menu[59] = array( '', 'read', '', '', 'wp-menu-separator' );
if ( current_user_can( 'switch_themes') ) {
$menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' );
@@ -232,7 +232,7 @@ $menu[80] = array( __('Settings'), 'manage_options', 'options-general.php', '',
$_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group
-$menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator-last' );
+$menu[99] = array( '', 'read', '', '', 'wp-menu-separator-last' );
// Back-compat for old top-levels
$_wp_real_parent_file['post.php'] = 'edit.php';