WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/29/2017 03:40:31 AM (4 years ago)
Author:
dd32
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.
Fixes #42713.

File:
1 edited

Legend:

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

    r42202 r42256  
    267267        if ( $user->first_name && $user->last_name ) {
    268268            echo "$user->first_name $user->last_name";
     269        } else if ( ! empty( $user->first_name ) ) {
     270            echo "$user->first_name";
     271        } else if ( ! empty( $user->last_name ) ) {
     272            echo "$user->last_name";
    269273        } else {
    270274            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.