Problem:
Want to change name order when customer login to customer dashboard.
Like this: Family name (Last Name) comes first and First name comes second.
Solution:
Please add this code in your theme’s or child theme’s functions.php file:
function wp_update_display_name ( $user_login, $user ) { $user_info = get_userdata($user->ID); $first_name = $user_info->first_name; $last_name = $user_info->last_name; wp_update_user(array('ID' => $user->ID, 'display_name' => $last_name . ' '. $first_name)); } add_action('wp_login', 'wp_update_display_name', PHP_INT_MAX, 2);
Relevant Documentation:
More info: https://wordpress.stackexchange.com/a/214214
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 12:00 – 17:00 | 12:00 – 17:00 | 12:00 – 17:00 | 12:00 – 17:00 | 12:00 – 17:00 | - |
- | 18:00 – 21:00 | 18:00 – 21:00 | 18:00 – 21:00 | 18:00 – 21:00 | 18:00 – 21:00 | - |
Supporter timezone: Asia/Karachi (GMT+05:00)
This topic contains 4 replies, has 2 voices.
Last updated by 7 years, 5 months ago.
Assisted by: Noman.