Merge pull request #10439 from shivapoudel/user-list

Tweaks API list table User column
This commit is contained in:
Mike Jolley 2016-02-29 12:17:39 +00:00
commit b9c423570f
1 changed files with 3 additions and 5 deletions

View File

@ -115,13 +115,11 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
return '';
}
$user_name = ! empty( $user->data->display_name ) ? $user->data->display_name : $user->data->user_login;
if ( current_user_can( 'edit_user' ) ) {
return '<a href="' . esc_url( add_query_arg( array( 'user_id' => $user->ID ), admin_url( 'user-edit.php' ) ) ) . '">' . esc_html( $user_name ) . '</a>';
if ( current_user_can( 'edit_user', $user->ID ) ) {
return '<a href="' . esc_url( add_query_arg( array( 'user_id' => $user->ID ), admin_url( 'user-edit.php' ) ) ) . '">' . esc_html( $user->display_name ) . '</a>';
}
return esc_html( $user_name );
return esc_html( $user->display_name );
}
/**