Make WordPress Core


Ignore:
Timestamp:
08/15/2006 10:13:36 PM (19 years ago)
Author:
ryan
Message:

More fun with menus.

File:
1 edited

Legend:

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

    r4097 r4100  
    7070}
    7171
     72$_wp_submenu_nopriv = array();
     73$_wp_menu_nopriv = array();
    7274// Loop over submenus and remove pages for which the user does not have privs.
    7375foreach ($submenu as $parent => $sub) {
     
    7577        if ( ! current_user_can($data[1]) ) {
    7678            unset($submenu[$parent][$index]);
     79            $_wp_submenu_nopriv[$parent][$data[2]] = true;
    7780        }
    7881    }
     
    119122            unset($menu[$id]);
    120123        }
    121     } else {
    122     /*  $subs = $submenu[$data[2]];
    123         $first_sub = array_shift($subs);
    124         $old_parent = $data[2];
    125         $new_parent = $first_sub[2];
    126         // If the first submenu is not the same as the assigned parent,
    127         // make the first submenu the new parent.
    128         if ( $new_parent != $old_parent ) {
    129             $_wp_real_parent_file[$old_parent] = $new_parent;
    130             $menu[$id][2] = $new_parent;
    131        
    132             foreach ($submenu[$old_parent] as $index => $data) {
    133                 $submenu[$new_parent][$index] = $submenu[$old_parent][$index];
    134                 unset($submenu[$old_parent][$index]);
    135             }
    136             unset($submenu[$old_parent]);
    137             $_wp_submenu_nopriv[$new_parent] = $_wp_submenu_nopriv[$old_parent];
    138         } */
    139124    }
    140125}
Note: See TracChangeset for help on using the changeset viewer.