Make WordPress Core


Ignore:
Timestamp:
03/08/2018 07:47:17 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Users: Display partial names in the user listing tables.
This allows showing a name when only the first or last name is provided.

Props shital-patel, antipole.
Merges [42256] and [42257] to the 4.9 branch.
Fixes #42713.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-admin/includes/class-wp-ms-users-list-table.php

    r41683 r42805  
    256256        if ( $user->first_name && $user->last_name ) {
    257257            echo "$user->first_name $user->last_name";
     258        } elseif ( $user->first_name ) {
     259            echo $user->first_name;
     260        } elseif ( $user->last_name ) {
     261            echo $user->last_name;
    258262        } else {
    259263            echo '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . _x( 'Unknown', 'name' ) . '</span>';
Note: See TracChangeset for help on using the changeset viewer.