Fix edit page menu highlighting. http://mosquito.wordpress.org/view.php?id=799 Hat tip: mdawaffe

git-svn-id: http://svn.automattic.com/wordpress/trunk@2401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-03-02 16:30:00 +00:00
parent ec8924fb5b
commit b9433193df
2 changed files with 7 additions and 2 deletions

View File

@ -35,8 +35,10 @@ foreach ($submenu["$parent_file"] as $item) :
continue; continue;
} }
if ( (isset($plugin_page) && $plugin_page == $item[2]) || (!isset($plugin_page) && substr($self, -10) == substr($item[2], -10)) ) $class = ' class="current"'; if ( isset($submenu_file) ) {
else if (isset($submenu_file) && $submenu_file == substr($item[2], -10)) $class = ' class="current"'; 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 = ''; else $class = '';
$menu_hook = get_plugin_page_hook($item[2], $parent_file); $menu_hook = get_plugin_page_hook($item[2], $parent_file);

View File

@ -22,6 +22,9 @@ if (isset($_POST['deletepost'])) {
$action = "delete"; $action = "delete";
} }
// Fix submenu highlighting for pages.
if (false !== strpos($_SERVER['HTTP_REFERER'], 'edit-pages.php')) $submenu_file = 'page-new.php';
switch($action) { switch($action) {
case 'post': case 'post':