mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-02 19:54:28 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@28500 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -71,22 +71,19 @@ unset($menu_page, $compat);
|
||||
$_wp_submenu_nopriv = array();
|
||||
$_wp_menu_nopriv = array();
|
||||
// Loop over submenus and remove pages for which the user does not have privs.
|
||||
foreach ( array( 'submenu' ) as $sub_loop ) {
|
||||
foreach ($$sub_loop as $parent => $sub) {
|
||||
foreach ($sub as $index => $data) {
|
||||
if ( ! current_user_can($data[1]) ) {
|
||||
unset(${$sub_loop}[$parent][$index]);
|
||||
$_wp_submenu_nopriv[$parent][$data[2]] = true;
|
||||
}
|
||||
foreach ($submenu as $parent => $sub) {
|
||||
foreach ($sub as $index => $data) {
|
||||
if ( ! current_user_can($data[1]) ) {
|
||||
unset($submenu[$parent][$index]);
|
||||
$_wp_submenu_nopriv[$parent][$data[2]] = true;
|
||||
}
|
||||
unset($index, $data);
|
||||
|
||||
if ( empty(${$sub_loop}[$parent]) )
|
||||
unset(${$sub_loop}[$parent]);
|
||||
}
|
||||
unset($sub, $parent);
|
||||
unset($index, $data);
|
||||
|
||||
if ( empty($submenu[$parent]) )
|
||||
unset($submenu[$parent]);
|
||||
}
|
||||
unset($sub_loop);
|
||||
unset($sub, $parent);
|
||||
|
||||
/*
|
||||
* Loop over the top-level menu.
|
||||
|
||||
Reference in New Issue
Block a user