WordPress.org

Make WordPress Core

Changeset 12737


Ignore:
Timestamp:
01/16/10 22:53:40 (4 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
  • branches/2.9/wp-admin/menu.php

    r12248 r12737  
    199199// Run re-parent loop again. 
    200200foreach ( $menu as $id => $data ) { 
     201    if ( ! current_user_can($data[1]) ) 
     202        $_wp_menu_nopriv[$data[2]] = true; 
     203 
    201204    // If submenu is empty... 
    202205    if ( empty($submenu[$data[2]]) ) { 
    203206        // And user doesn't have privs, remove menu. 
    204         if ( ! current_user_can($data[1]) ) { 
    205             $_wp_menu_nopriv[$data[2]] = true; 
     207        if ( isset( $_wp_menu_nopriv[$data[2]] ) ) { 
    206208            unset($menu[$id]); 
    207209        } 
Note: See TracChangeset for help on using the changeset viewer.