diff --git a/wp-admin/menu-header.php b/wp-admin/menu-header.php index 7960a16059..db9a21ba42 100644 --- a/wp-admin/menu-header.php +++ b/wp-admin/menu-header.php @@ -35,8 +35,10 @@ foreach ($submenu["$parent_file"] as $item) : continue; } -if ( (isset($plugin_page) && $plugin_page == $item[2]) || (!isset($plugin_page) && substr($self, -10) == substr($item[2], -10)) ) $class = ' class="current"'; -else if (isset($submenu_file) && $submenu_file == substr($item[2], -10)) $class = ' class="current"'; +if ( isset($submenu_file) ) { + if ( substr($submenu_file, -10) == substr($item[2], -10) ) $class = ' class="current"'; + else $class = ''; +} else if ( (isset($plugin_page) && $plugin_page == $item[2]) || (!isset($plugin_page) && substr($self, -10) == substr($item[2], -10)) ) $class = ' class="current"'; else $class = ''; $menu_hook = get_plugin_page_hook($item[2], $parent_file); diff --git a/wp-admin/post.php b/wp-admin/post.php index 95bb41affa..66cdb452d3 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -22,6 +22,9 @@ if (isset($_POST['deletepost'])) { $action = "delete"; } + // Fix submenu highlighting for pages. +if (false !== strpos($_SERVER['HTTP_REFERER'], 'edit-pages.php')) $submenu_file = 'page-new.php'; + switch($action) { case 'post':