WordPress.org

Make WordPress Core

Opened 2 months ago

Last modified 4 weeks ago

#53889 new enhancement

Adding Pronouns field on the user meta

Reported by: felipeloureirosantos Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Users Keywords: has-patch needs-testing
Focuses: Cc:

Description

I see that @jonoaldersonwp mentioned about adding Pronouns for profiles on core after I created the meta ticket for adding on Profiles, so decided to create a new ticket for core as I fully agree that it would make sense.

As I mentioned on the other ticket, the same applies here: I see that we have added a pronouns' field on the Make WordPress Slack workspace, and I believe it would be great to have something like that on the user meta for the WordPress core.

Personally, I believe that's even more relevant when speaking some languages like Portuguese that don't have a neutral pronoun (not even a singular use of they/them).

Additionally, I believe that's something that we could add automatically to the "Display name" for new WordPress installations, at least the same way that we had "First name" and "Last name".

Not sure if adding already some default options (with an "Other" option) on a select field would make it less inclusive or not, but mentioning as a possibility as it's something that came to my mind.

Attachments (1)

i1.mp4 (1.6 MB) - added by felipeloureirosantos 2 months ago.
iteration 1 demo for using pronouns on WordPress user meta

Download all attachments as: .zip

Change History (13)

#1 @felipeloureirosantos
2 months ago

  • Summary changed from Adding Pronouns field on the profiles to Adding Pronouns field on the user meta

This ticket was mentioned in Slack in #meta by felipeloureirosantos. View the logs.


2 months ago

This ticket was mentioned in PR #1550 on WordPress/wordpress-develop by felipelousantos.


2 months ago

  • Keywords has-patch added

Adding pronouns on user meta and show as an option on the display name field.

Trac ticket: https://core.trac.wordpress.org/ticket/53889

@felipeloureirosantos
2 months ago

iteration 1 demo for using pronouns on WordPress user meta

#4 follow-up: @johnbillion
2 months ago

  • Keywords needs-testing added

This is a duplicate of #42900 but the PR on this ticket is more comprehensive.

#5 @prbot
7 weeks ago

TimothyBJacobs commented on PR #1550:

Thanks for the PR @felipelousantos!

I don't think we need to make changes to the upgrade_160 function. This is used when upgrading from a much older version of WordPress, and I don't think there would be a situation where that upgrade routine is running and there are pronouns defined for those users.

Another thing I wonder is if the way pronouns are appended to a name needs to be localized. Is that represented differently in different languages? In other words, something like the following instead of "{$user->first_name} ({$user→pronouns})". Cc: @swissspidy, @ocean90, @SergeyBiryukov.

{{{`
/* translators: 1. Name 2. Pronouns */
sprintf( _x( '%1$s (%2$s)', 'Name with pronouns' ), $user->first_name, $user->pronouns );
}}}

#6 in reply to: ↑ 4 ; follow-up: @swissspidy
7 weeks ago

Replying to johnbillion:

This is a duplicate of #42900 but the PR on this ticket is more comprehensive.

Sort of, but the current PR here does not solve the case outlined in the related ticket, #42725.

Supporting gender-based translations is not possible if pronouns is a freeform field.

#7 @prbot
7 weeks ago

SergeyBiryukov commented on PR #1550:

Another thing I wonder is if the way pronouns are appended to a name needs to be localized. Is that represented differently in different languages? In other words, something like the following instead of "{$user->first_name} ({$user→pronouns})".

/* translators: 1. Name 2. Pronouns */
sprintf( _x( '%1$s (%2$s)', 'Name with pronouns' ), $user->first_name, $user->pronouns );

Good call, that would indeed be my suggestion here.

#8 in reply to: ↑ 6 ; follow-up: @johnbillion
7 weeks ago

Replying to swissspidy:

Supporting gender-based translations is not possible if pronouns is a freeform field.

Pronouns and grammatical gender are two different things.

Languages have a fixed set of grammatical genders, usually masculine, feminine, and neutral. A user who uses a gender-neutral pronoun such as "they/them" may still wish to select their preferred grammatical gender (eg. feminine) if the language they use doesn't support genuinely gender-neutral grammar.

#9 @prbot
5 weeks ago

amieiro commented on PR #1550:

I have added a PR in the Felipe's repo to resolve the errors in the tests.

#10 in reply to: ↑ 8 @swissspidy
5 weeks ago

Replying to johnbillion:

Replying to swissspidy:

Supporting gender-based translations is not possible if pronouns is a freeform field.

Pronouns and grammatical gender are two different things.

Languages have a fixed set of grammatical genders, usually masculine, feminine, and neutral. A user who uses a gender-neutral pronoun such as "they/them" may still wish to select their preferred grammatical gender (eg. feminine) if the language they use doesn't support genuinely gender-neutral grammar.

True, which is why I disagree with this being a 100% duplicate of #42900, because the PR here does not fully address that ticket.

#11 @prbot
5 weeks ago

felipelousantos commented on PR #1550:

Thanks for the help, @amieiro! 😄

Another thing I wonder is if the way pronouns are appended to a name needs to be localized. Is that represented differently in different languages? In other words, something like the following instead of "{$user->first_name} ({$user→pronouns})"

I totally agree @TimothyBJacobs! I was checking the code for adding something like that, but doesn't seem like something that we can only change on a specific place.

I see that it would need to change on other places like src/wp-admin/user-edit.php, src/wp-admin/includes/class-wp-users-list-table.php, and src/wp-admin/includes/class-wp-ms-users-list-table.php.

Also, I don't think that we would need to create several strings for that, but only 1 with the format that should follow for the name with the pronouns, right?

I'm not sure if I'm missing something here. I don't have a lot of experience with that, so would appreciate any help. :)

#12 @prbot
4 weeks ago

TimothyBJacobs commented on PR #1550:

Thanks for the help, @amieiro! 😄

Another thing I wonder is if the way pronouns are appended to a name needs to be localized. Is that represented differently in different languages? In other words, something like the following instead of "{$user->first_name} ({$user→pronouns})"

I totally agree @TimothyBJacobs! I was checking the code for adding something like that, but doesn't seem like something that we can only change on a specific place.

I see that it would need to change on other places like src/wp-admin/user-edit.php, src/wp-admin/includes/class-wp-users-list-table.php, and src/wp-admin/includes/class-wp-ms-users-list-table.php.

Also, I don't think that we would need to create several strings for that, but only 1 with the format that should follow for the name with the pronouns, right?

I'm not sure if I'm missing something here. I don't have a lot of experience with that, so would appreciate any help. :)

It may make sense to extract this repetitive code to a method on WP_User that we can then use in all of those places.

Also, I don't think that we would need to create several strings for that, but only 1 with the format that should follow for the name with the pronouns, right?

I'm not sure, I'd want to ask @SergeyBiryukov again :) Do we want a separate string for first name + pronouns, full name + pronouns, etc...? Or would just one work?

Note: See TracTickets for help on using tickets.