Changes in trunk/wp-admin/includes/menu.php [18109:16471]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/menu.php
r18109 r16471 103 103 $_wp_menu_nopriv[$data[2]] = true; 104 104 105 // If there is only one submenu and it is has same destination as the parent,106 // remove the submenu.107 if ( ! empty( $submenu[$data[2]] ) && 1 == count ( $submenu[$data[2]] ) ) {108 $subs = $submenu[$data[2]];109 $first_sub = array_shift($subs);110 if ( $data[2] == $first_sub[2] )111 unset( $submenu[$data[2]] );112 }113 114 105 // If submenu is empty... 115 106 if ( empty($submenu[$data[2]]) ) { … … 120 111 } 121 112 } 122 unset($id, $data , $subs, $first_sub);123 124 // Remove any duplicated sep arators125 $sep arator_found = false;113 unset($id, $data); 114 115 // Remove any duplicated seperators 116 $seperator_found = false; 126 117 foreach ( $menu as $id => $data ) { 127 118 if ( 0 == strcmp('wp-menu-separator', $data[4] ) ) { 128 if (false == $sep arator_found) {129 $sep arator_found = true;119 if (false == $seperator_found) { 120 $seperator_found = true; 130 121 } else { 131 122 unset($menu[$id]); 132 $sep arator_found = false;123 $seperator_found = false; 133 124 } 134 125 } else { 135 $sep arator_found = false;126 $seperator_found = false; 136 127 } 137 128 } … … 215 206 } 216 207 217 // Remove the last menu item if it is a separator.218 $last_menu_key = array_pop( array_keys( $menu ) );219 if ( 'wp-menu-separator' == $menu[ $last_menu_key ][ 4 ] )220 unset( $menu[ $last_menu_key ] );221 unset( $last_menu_key );222 223 208 if ( !user_can_access_admin_page() ) { 224 209 do_action('admin_page_access_denied');
Note: See TracChangeset
for help on using the changeset viewer.