Make WordPress Core


Ignore:
Timestamp:
06/14/2022 02:41:10 PM (3 years ago)
Author:
SergeyBiryukov
Message:

I18N: Use a translatable string for displaying a user's first name and last name.

That allows locales to switch the order of the first name and last name, should they prefer to do so.

The string was previously used in wp_insert_user() and is now reused in other places for consistency:

  • WP_MS_Users_List_Table::column_name()
  • WP_Users_List_Table::column_name()​
  • wp_list_authors()
  • wp_list_users()

Note: This also removes the wp_list_author_full_name filter, introduced for the same purpose in wp_list_authors(), as redundant for now.

Follow-up to [53486].

See #17025.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-users-list-table.php

    r53011 r53501  
    569569                    case 'name':
    570570                        if ( $user_object->first_name && $user_object->last_name ) {
    571                             $r .= "$user_object->first_name $user_object->last_name";
     571                            $r .= sprintf(
     572                                /* translators: 1: User's first name, 2: Last name. */
     573                                _x( '%1$s %2$s', 'Display name based on first name and last name' ),
     574                                $user_object->first_name,
     575                                $user_object->last_name
     576                            );
    572577                        } elseif ( $user_object->first_name ) {
    573578                            $r .= $user_object->first_name;
Note: See TracChangeset for help on using the changeset viewer.