WordPress.org

Make WordPress Core

Changeset 12738


Ignore:
Timestamp:
01/16/10 22:59:27 (5 years ago)
Author:
westi
Message:

Ensure that inaccessible parent menus are marked as such even if they have accessible children. See #11922.

File:
1 edited

Legend:

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

    r12733 r12738  
    247247// Run re-parent loop again. 
    248248foreach ( $menu as $id => $data ) { 
     249    if ( ! current_user_can($data[1]) ) 
     250        $_wp_menu_nopriv[$data[2]] = true; 
     251 
    249252    // If submenu is empty... 
    250253    if ( empty($submenu[$data[2]]) ) { 
    251254        // And user doesn't have privs, remove menu. 
    252         if ( ! current_user_can($data[1]) ) { 
    253             $_wp_menu_nopriv[$data[2]] = true; 
     255        if ( isset( $_wp_menu_nopriv[$data[2]] ) ) { 
    254256            unset($menu[$id]); 
    255257        } 
Note: See TracChangeset for help on using the changeset viewer.