Q:

Create column in wordpress user page

I'm trying to display a custom column in user admin page (wp-admin/users.php).
The custom column (called eg. MY Column) should display
FirstNameLastName-IDuser

Eg: John Doe has ID 356 the column should display:
JohnDoe-356

To understand how to do it, I'm starting from this code to display a column with user ID:
function rd_user_id_column( $columns ) {
    $columns['user_id'] = 'ID';
   return $columns;
}
add_filter('manage_users_columns', 'rd_user_id_column');

/*
* Column content
*/
function rd_user_id_column_content($value, $column_name, $user_id) {
    if ( 'user_id' == $column_name )
        return $user_id;
    return $value;
}
add_action('manage_users_custom_column',  'rd_user_id_column_content', 10, 3);

/*
 * Column style (you can skip this if you want)
 */
function rd_user_id_column_style(){
    echo '<style>.column-user_id{width: 5%}</style>';
}
add_action('admin_head-users.php',  'rd_user_id_column_style');

I'm not sure where I integrate the code with the user_firstname and user_lastname. Should I create a new function?
Thank you

A:

Pleaes replace the rd_user_id_column_content function as below.
/*
* Column content
*/
function rd_user_id_column_content($value, $column_name, $user_id) {
    $user=get_user_by( 'ID',$user_id );
    if ( 'user_id' == $column_name )
        return $user->first_name.$user->last_name.'-'.$user_id;
    return $value;
}
add_action('manage_users_custom_column',  'rd_user_id_column_content', 10, 3);

