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:
parent
ec8924fb5b
commit
b9433193df
|
@ -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);
|
||||
|
|
|
@ -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':
|
||||
|
||||
|
|
Loading…
Reference in New Issue