WordPress.org

Make WordPress Core

Ticket #18533: wp.patch

File wp.patch, 888 bytes (added by llucax, 4 years ago)

Trivial patch

  • wp-admin/includes/menu.php

    commit 6fc6bc6b8d5727d38b9fb198b6504eee5045fbfd
    Author: Leandro Lucarella <llucax@gmail.com>
    Date:   Sat Aug 27 21:58:18 2011 -0300
    
        WP: Allow menu structure without a Dashboard
    
    diff --git a/wp-admin/includes/menu.php b/wp-admin/includes/menu.php
    index fa85e4b..7fe11b0 100644
    a b function add_menu_classes($menu) { 
    147147        $first = $lastorder = false; 
    148148        $i = 0; 
    149149        $mc = count($menu); 
     150        $first_order = reset(array_keys($menu)); 
    150151        foreach ( $menu as $order => $top ) { 
    151152                $i++; 
    152153 
    153                 if ( 0 == $order ) { // dashboard is always shown/single 
    154                         $menu[0][4] = add_cssclass('menu-top-first', $top[4]); 
    155                         $lastorder = 0; 
     154                if ( $first_order == $order ) { // dashboard is always shown/single 
     155                        $menu[$order][4] = add_cssclass('menu-top-first', $top[4]); 
     156                        $lastorder = $first_order; 
    156157                        continue; 
    157158                } 
    158159