Changeset 42202
- Timestamp:
- 11/17/2017 09:34:01 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php
r41683 r42202 234 234 $super_admins = get_super_admins(); 235 235 $avatar = get_avatar( $user->user_email, 32 ); 236 $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );237 236 238 237 echo $avatar; 239 238 240 ?><strong><a href="<?php echo $edit_link; ?>" class="edit"><?php echo $user->user_login; ?></a><?php 241 if ( in_array( $user->user_login, $super_admins ) ) { 242 echo ' — ' . __( 'Super Admin' ); 243 } 244 ?></strong> 245 <?php 239 if ( current_user_can( 'edit_user', $user->ID ) ) { 240 $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) ); 241 $edit = "<a href=\"{$edit_link}\">{$user->user_login}</a>"; 242 } else { 243 $edit = $user->user_login; 244 } 245 246 ?> 247 <strong> 248 <?php 249 echo $edit; 250 251 if ( in_array( $user->user_login, $super_admins ) ) { 252 echo ' — ' . __( 'Super Admin' ); 253 } 254 ?> 255 </strong> 256 <?php 246 257 } 247 258 … … 430 441 431 442 $super_admins = get_super_admins(); 432 $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );433 443 434 444 $actions = array(); 435 $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>'; 445 446 if ( current_user_can( 'edit_user', $user->ID ) ) { 447 $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) ); 448 $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>'; 449 } 436 450 437 451 if ( current_user_can( 'delete_user', $user->ID ) && ! in_array( $user->user_login, $super_admins ) ) {
Note: See TracChangeset
for help on using the changeset viewer.