Reply To: Replace firstname user in topic by other field
You can manually change any set up already from their profile.
For new users you can change this at registration
eg
function change_display_name( $user_id ) {
$info = get_userdata( $user_id );
$args = array(
'ID' => $user_id,
'display_name' => $info->first_name . ' ' . $info->last_name
);
wp_update_user( $args );
}
add_action('user_register','change_display_name');
you have options of
‘display_name’ => $info->user_login
or
‘display_name’ => $info->user_email
or
‘display_name’ => $info->user_nicename
or if you have a custom field, you can use that
Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use