Make WordPress Core


Ignore:
Timestamp:
06/27/2017 12:26:07 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Administration: In user list tables, display a dash instead of a blank space and add "Unknown" as a screen reader text when the user's first name and last name are blank.

Props Girishpanchal, yahil.
Fixes #40628.

File:
1 edited

Legend:

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

    r40310 r40956  
    259259     */
    260260    public function column_name( $user ) {
    261         echo "$user->first_name $user->last_name";
     261        if ( $user->first_name && $user->last_name ) {
     262            echo "$user->first_name $user->last_name";
     263        } else {
     264            echo '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . _x( 'Unknown', 'name' ) . '</span>';
     265        }
    262266    }
    263267
Note: See TracChangeset for help on using the changeset viewer.