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

git-svn-id: https://develop.svn.wordpress.org/trunk@2401 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2005-03-02 16:30:00 +00:00
parent 8eb5fc62f0
commit 16afe16dbe
2 changed files with 7 additions and 2 deletions

View File

@ -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);

View File

@ -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':