diff --git a/src/wp-admin/includes/class-wp-ms-users-list-table.php b/src/wp-admin/includes/class-wp-ms-users-list-table.php
index 86af8becbe..cefe693749 100644
--- a/src/wp-admin/includes/class-wp-ms-users-list-table.php
+++ b/src/wp-admin/includes/class-wp-ms-users-list-table.php
@@ -233,16 +233,27 @@ class WP_MS_Users_List_Table extends WP_List_Table {
public function column_username( $user ) {
$super_admins = get_super_admins();
$avatar = get_avatar( $user->user_email, 32 );
- $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );
echo $avatar;
- ?>user_login; ?>user_login, $super_admins ) ) {
- echo ' — ' . __( 'Super Admin' );
+ if ( current_user_can( 'edit_user', $user->ID ) ) {
+ $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );
+ $edit = "{$user->user_login}";
+ } else {
+ $edit = $user->user_login;
}
- ?>
-
+
+ user_login, $super_admins ) ) {
+ echo ' — ' . __( 'Super Admin' );
+ }
+ ?>
+
+ ID ) ) );
$actions = array();
- $actions['edit'] = '' . __( 'Edit' ) . '';
+
+ if ( current_user_can( 'edit_user', $user->ID ) ) {
+ $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );
+ $actions['edit'] = '' . __( 'Edit' ) . '';
+ }
if ( current_user_can( 'delete_user', $user->ID ) && ! in_array( $user->user_login, $super_admins ) ) {
$actions['delete'] = '' . __( 'Delete' ) . '';