WordPress.org

Make WordPress Core


Ignore:
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.