#47522 closed enhancement (duplicate)
Make name fields in profile page swappable and modifiable by locales
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.3 |
Component: | I18N | Keywords: | has-patch |
Focuses: | ui, administration | Cc: |
Description
On the user profile page, the first name field precedes the last name field. In some locales, an order of name parts is different. For example, in some Asian locales(Chinese, Japanese, Korean, and Vietnamese), some part of Europe(Hungarian). And in some locales, name parts can be more than 2.
Examples
Below is the list of name patterns par locales. I'm not a linguist, so they may have incorrect information or a shortage.
e.g. English
Philip | Roth |
---|---|
First Name | Last Name |
This style is very common in many locales and default of WordPress.
e.g. Japanese
Murakami | Haruki |
---|---|
Family Name | First Name |
Family name(last name) comes first. CJKV, some part of Europe, and so on.
e.g. Russian:
Fyodor | Mikhailovich | Dostoevsky |
---|---|---|
First Name | Patronym | Last Name |
Having multiple name parts. Some of the parts may be omitted with some reason.
Plans
- Change
profile.php
to adopt a filter hook for name fields. - Name order is swappable with
.po
file like `wp_trim_words is. https://developer.wordpress.org/reference/functions/wp_trim_words/ - Options API is also modifiable for extra name parts.
Related tickets: #47511
Helpful resources: https://www.w3.org/International/questions/qa-personal-names
Attachments (3)
Change History (8)
#1
@
6 years ago
- Keywords has-patch added; needs-patch removed
Added new function wp_get_user_name_parts()
to get an assoc array like this.
<?php [ 'first_name' => __( 'First Name' ), 'last_name' => __( 'Last Name' ), ]
- This order can be controlled with
_x( 'first_name,last_name' )
. - User edit function and admin screen are also relied on
wp_get_user_name_parts()
. - Select box for display_name is not fixed yet.
- Should consider how first_name and last_name are used in front part of the site(theme).
Any feedbacks are welcomed!
#3
@
6 years ago
I'd like to see the first and last name fields removed and replaced by a single field for the user's name.
@Takahashi_Fumiki Do you have any interest in contributing to #6148 instead?
Add new function wp_get_user_name_parts