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. Built from https://develop.svn.wordpress.org/trunk@42256 git-svn-id: http://core.svn.wordpress.org/trunk@42085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b17405c3fe
commit
05d60f74ed
|
@ -266,6 +266,10 @@ class WP_MS_Users_List_Table extends WP_List_Table {
|
|||
public function column_name( $user ) {
|
||||
if ( $user->first_name && $user->last_name ) {
|
||||
echo "$user->first_name $user->last_name";
|
||||
} else if ( ! empty( $user->first_name ) ) {
|
||||
echo "$user->first_name";
|
||||
} else if ( ! empty( $user->last_name ) ) {
|
||||
echo "$user->last_name";
|
||||
} else {
|
||||
echo '<span aria-hidden="true">—</span><span class="screen-reader-text">' . _x( 'Unknown', 'name' ) . '</span>';
|
||||
}
|
||||
|
|
|
@ -488,6 +488,10 @@ class WP_Users_List_Table extends WP_List_Table {
|
|||
case 'name':
|
||||
if ( $user_object->first_name && $user_object->last_name ) {
|
||||
$r .= "$user_object->first_name $user_object->last_name";
|
||||
} else if ( ! empty( $user_object->first_name ) ) {
|
||||
$r .= "$user_object->first_name";
|
||||
} else if ( ! empty( $user_object->last_name) ) {
|
||||
$r .= "$user_object->last_name";
|
||||
} else {
|
||||
$r .= '<span aria-hidden="true">—</span><span class="screen-reader-text">' . _x( 'Unknown', 'name' ) . '</span>';
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.0-alpha-42255';
|
||||
$wp_version = '5.0-alpha-42256';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue