Sort the menu before adding classes. see #7966
git-svn-id: http://svn.automattic.com/wordpress/trunk@9580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
50b407dc4b
commit
b10351e5c6
|
@ -570,11 +570,11 @@ function add_object_page( $page_title, $menu_title, $access_level, $file, $funct
|
||||||
if ( empty($icon_url) )
|
if ( empty($icon_url) )
|
||||||
$icon_url = 'images/menu/generic.png';
|
$icon_url = 'images/menu/generic.png';
|
||||||
|
|
||||||
$menu[$_wp_last_object_menu][4] = ''; // Remove menu-top-last
|
//$menu[$_wp_last_object_menu][4] = ''; // Remove menu-top-last
|
||||||
|
|
||||||
$_wp_last_object_menu++;
|
$_wp_last_object_menu++;
|
||||||
|
|
||||||
$menu[$_wp_last_object_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top-last ' . $hookname, $hookname, $icon_url );
|
$menu[$_wp_last_object_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
|
||||||
|
|
||||||
return $hookname;
|
return $hookname;
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,10 +220,10 @@ function add_menu_classes($menu) {
|
||||||
return apply_filters( 'add_menu_classes', $menu );
|
return apply_filters( 'add_menu_classes', $menu );
|
||||||
}
|
}
|
||||||
|
|
||||||
$menu = add_menu_classes($menu);
|
|
||||||
|
|
||||||
uksort($menu, "strnatcasecmp"); // make it all pretty
|
uksort($menu, "strnatcasecmp"); // make it all pretty
|
||||||
|
|
||||||
|
$menu = add_menu_classes($menu);
|
||||||
|
|
||||||
if (! user_can_access_admin_page()) {
|
if (! user_can_access_admin_page()) {
|
||||||
do_action('admin_page_access_denied');
|
do_action('admin_page_access_denied');
|
||||||
wp_die( __('You do not have sufficient permissions to access this page.') );
|
wp_die( __('You do not have sufficient permissions to access this page.') );
|
||||||
|
|
Loading…
Reference in New Issue