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.
Built from https://develop.svn.wordpress.org/trunk@40956


git-svn-id: http://core.svn.wordpress.org/trunk@40806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2017-06-27 00:27:39 +00:00
parent d08982bdbc
commit 25e94961b4
3 changed files with 11 additions and 3 deletions

View File

@ -258,7 +258,11 @@ class WP_MS_Users_List_Table extends WP_List_Table {
* @param WP_User $user The current WP_User object.
*/
public function column_name( $user ) {
if ( $user->first_name && $user->last_name ) {
echo "$user->first_name $user->last_name";
} else {
echo '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . _x( 'Unknown', 'name' ) . '</span>';
}
}
/**

View File

@ -471,7 +471,11 @@ class WP_Users_List_Table extends WP_List_Table {
$r .= "$avatar $edit";
break;
case 'name':
if ( $user_object->first_name && $user_object->last_name ) {
$r .= "$user_object->first_name $user_object->last_name";
} else {
$r .= '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">' . _x( 'Unknown', 'name' ) . '</span>';
}
break;
case 'email':
$r .= "<a href='" . esc_url( "mailto:$email" ) . "'>$email</a>";

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-alpha-40955';
$wp_version = '4.9-alpha-40956';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.