WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/07/2011 06:45:22 PM (10 years ago)
Author:
azaozz
Message:

Don't refresh the admin menu after page load, apply the user-state from PHP, fix behaviour after folding the menu, props nacin, props nuxwin, fixes #10646, fixes #17058

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/menu-header.php

    r15866 r17623  
    3737    global $self, $parent_file, $submenu_file, $plugin_page, $pagenow, $typenow;
    3838
     39    $menu_setting_increment = -1;
     40    $user_settings = get_all_user_settings();
     41
    3942    $first = true;
    4043    // 0 = name, 1 = capability, 2 = file, 3 = class, 4 = id, 5 = icon src
     
    4649            $first = false;
    4750        }
    48         if ( !empty($submenu[$item[2]]) )
     51        if ( !empty($submenu[$item[2]]) ) {
    4952            $class[] = 'wp-has-submenu';
     53            $menu_setting_increment++;
     54        }
    5055
    5156        if ( ( $parent_file && $item[2] == $parent_file ) || ( empty($typenow) && $self == $item[2] ) ) {
     
    5459            else
    5560                $class[] = 'current';
     61        } elseif ( ! empty( $submenu[ $item[2] ] ) && isset( $user_settings[ 'm' . $menu_setting_increment ] ) && 'o' == $user_settings[ 'm' . $menu_setting_increment ] ) {
     62                $class[] = 'wp-menu-open';
    5663        }
    5764
Note: See TracChangeset for help on using the changeset viewer.