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-users-list-table.php

    r41753 r42256  
    489489                        if ( $user_object->first_name && $user_object->last_name ) {
    490490                            $r .= "$user_object->first_name $user_object->last_name";
     491                        } else if ( ! empty( $user_object->first_name ) ) {
     492                            $r .= "$user_object->first_name";
     493                        } else if ( ! empty( $user_object->last_name) ) {
     494                            $r .= "$user_object->last_name";
    491495                        } else {
    492496                            $r .= '<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.