Changeset 47084 for trunk/src/wp-admin/includes/menu.php
- Timestamp:
- 01/18/2020 12:52:28 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/menu.php
r45583 r47084 209 209 $i++; 210 210 211 if ( 0 == $order ) { // dashboard is always shown/single211 if ( 0 == $order ) { // Dashboard is always shown/single. 212 212 $menu[0][4] = add_cssclass( 'menu-top-first', $top[4] ); 213 213 $lastorder = 0; … … 215 215 } 216 216 217 if ( 0 === strpos( $top[2], 'separator' ) && false !== $lastorder ) { // if separator217 if ( 0 === strpos( $top[2], 'separator' ) && false !== $lastorder ) { // If separator. 218 218 $first = true; 219 219 $c = $menu[ $lastorder ][4]; … … 228 228 } 229 229 230 if ( $mc == $i ) { // last item230 if ( $mc == $i ) { // Last item. 231 231 $c = $menu[ $order ][4]; 232 232 $menu[ $order ][4] = add_cssclass( 'menu-top-last', $c ); … … 246 246 } 247 247 248 uksort( $menu, 'strnatcasecmp' ); // make it all pretty248 uksort( $menu, 'strnatcasecmp' ); // Make it all pretty. 249 249 250 250 /** … … 311 311 } 312 312 313 // Prevent adjacent separators 313 // Prevent adjacent separators. 314 314 $prev_menu_was_separator = false; 315 315 foreach ( $menu as $id => $data ) { 316 316 if ( false === stristr( $data[4], 'wp-menu-separator' ) ) { 317 317 318 // This item is not a separator, so falsey the toggler and do nothing 318 // This item is not a separator, so falsey the toggler and do nothing. 319 319 $prev_menu_was_separator = false; 320 320 } else { 321 321 322 // The previous item was a separator, so unset this one 322 // The previous item was a separator, so unset this one. 323 323 if ( true === $prev_menu_was_separator ) { 324 324 unset( $menu[ $id ] ); 325 325 } 326 326 327 // This item is a separator, so truthy the toggler and move on 327 // This item is a separator, so truthy the toggler and move on. 328 328 $prev_menu_was_separator = true; 329 329 }
Note: See TracChangeset
for help on using the changeset viewer.