Use wp-menu-separator after Settings and before the first plugin top-level. Remove trailing separators. fixes #17629

git-svn-id: https://develop.svn.wordpress.org/trunk@18089 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2011-06-01 14:41:43 +00:00
parent 384371a6f3
commit 2960bcac77
2 changed files with 8 additions and 1 deletions

View File

@ -214,6 +214,13 @@ if ( apply_filters('custom_menu_order', false) ) {
unset($menu_order, $default_menu_order); unset($menu_order, $default_menu_order);
} }
// Remove the last menu item if it is a separator.
$last_menu_item = end( $menu );
if ( 'wp-menu-separator' == $last_menu_item[ 4 ] )
array_pop( $menu );
reset( $menu );
unset( $last_menu_item );
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.') );

View File

@ -234,7 +234,7 @@ $menu[80] = array( __('Settings'), 'manage_options', 'options-general.php', '',
$_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group $_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group
$menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator-last' ); $menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator' );
// Back-compat for old top-levels // Back-compat for old top-levels
$_wp_real_parent_file['post.php'] = 'edit.php'; $_wp_real_parent_file['post.php'] = 'edit.php';