Make WordPress Core


Ignore:
Timestamp:
05/19/2014 05:03:44 AM (11 years ago)
Author:
wonderboymusic
Message:

Fix some hackificator odds and ends in wp-admin:

  • wp-activate.php and wp-admin/themes.php don't need the closing PHP tag
  • Switch single quotes for HTML attribute values to double in a few places
  • Convert include_once file.php syntax to include_once( 'file.php' )
  • Add access modifiers to methods/members in: _WP_List_Table_Compat, Walker_Nav_Menu_Edit, Walker_Nav_Menu_Checklist, WP_Screen, Walker_Category_Checklist
  • edit_user() doesn't need to import the $wpdb global
  • wp_list_widgets() doesn't need to import the $sidebars_widgets global
  • switch/endswitch syntax is not supported in Hack
  • A <ul> in wp-admin/users.php is unclosed

See #27881.

File:
1 edited

Legend:

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

    r27671 r28500  
    7272$_wp_menu_nopriv = array();
    7373// Loop over submenus and remove pages for which the user does not have privs.
    74 foreach ( array( 'submenu' ) as $sub_loop ) {
    75     foreach ($$sub_loop as $parent => $sub) {
    76         foreach ($sub as $index => $data) {
    77             if ( ! current_user_can($data[1]) ) {
    78                 unset(${$sub_loop}[$parent][$index]);
    79                 $_wp_submenu_nopriv[$parent][$data[2]] = true;
    80             }
    81         }
    82         unset($index, $data);
    83 
    84         if ( empty(${$sub_loop}[$parent]) )
    85             unset(${$sub_loop}[$parent]);
    86     }
    87     unset($sub, $parent);
    88 }
    89 unset($sub_loop);
     74foreach ($submenu as $parent => $sub) {
     75    foreach ($sub as $index => $data) {
     76        if ( ! current_user_can($data[1]) ) {
     77            unset($submenu[$parent][$index]);
     78            $_wp_submenu_nopriv[$parent][$data[2]] = true;
     79        }
     80    }
     81    unset($index, $data);
     82
     83    if ( empty($submenu[$parent]) )
     84        unset($submenu[$parent]);
     85}
     86unset($sub, $parent);
    9087
    9188/*
Note: See TracChangeset for help on using the changeset viewer.