Make WordPress Core

Changeset 13931


Ignore:
Timestamp:
04/02/2010 03:40:49 AM (15 years ago)
Author:
wpmuguru
Message:

fix caps check on delete user link, props ocean90, see #12793

File:
1 edited

Legend:

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

    r13827 r13931  
    18101810
    18111811        // Set up the hover actions for this user
     1812        $del_cap_type = 'remove';
     1813        if ( !is_multisite() && current_user_can('delete_users') )
     1814            $del_cap_type = 'delete';
     1815
    18121816        $actions = array();
    18131817        $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
    1814         if ( $current_user->ID != $user_object->ID )
     1818        if ( $current_user->ID != $user_object->ID && current_user_can( $del_cap_type . '_user', $user_object->ID ) )
    18151819            $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=delete&amp;user=$user_object->ID", 'bulk-users') . "'>" . __('Delete') . "</a>";
    18161820        $actions = apply_filters('user_row_actions', $actions, $user_object);
Note: See TracChangeset for help on using the changeset viewer.