From 23a82e96194e2bfb923fdc81331ad441446a8757 Mon Sep 17 00:00:00 2001 From: wpmuguru Date: Fri, 2 Apr 2010 03:40:49 +0000 Subject: [PATCH] fix caps check on delete user link, props ocean90, see #12793 git-svn-id: http://svn.automattic.com/wordpress/trunk@13931 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index cfa3dcc620..07cff56258 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1809,9 +1809,13 @@ function user_row( $user_object, $style = '', $role = '', $numposts = 0 ) { $edit = "$user_object->user_login
"; // Set up the hover actions for this user + $del_cap_type = 'remove'; + if ( !is_multisite() && current_user_can('delete_users') ) + $del_cap_type = 'delete'; + $actions = array(); $actions['edit'] = '' . __('Edit') . ''; - if ( $current_user->ID != $user_object->ID ) + if ( $current_user->ID != $user_object->ID && current_user_can( $del_cap_type . '_user', $user_object->ID ) ) $actions['delete'] = "" . __('Delete') . ""; $actions = apply_filters('user_row_actions', $actions, $user_object); $action_count = count($actions);