mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 23:17:51 +01:00
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. Merges [42256] and [42257] to the 4.9 branch. Fixes #42713. Built from https://develop.svn.wordpress.org/branches/4.9@42805 git-svn-id: http://core.svn.wordpress.org/branches/4.9@42635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
08aa0f52f9
commit
e0f0ee5de6
@ -255,6 +255,10 @@ class WP_MS_Users_List_Table extends WP_List_Table {
|
|||||||
public function column_name( $user ) {
|
public function column_name( $user ) {
|
||||||
if ( $user->first_name && $user->last_name ) {
|
if ( $user->first_name && $user->last_name ) {
|
||||||
echo "$user->first_name $user->last_name";
|
echo "$user->first_name $user->last_name";
|
||||||
|
} elseif ( $user->first_name ) {
|
||||||
|
echo $user->first_name;
|
||||||
|
} elseif ( $user->last_name ) {
|
||||||
|
echo $user->last_name;
|
||||||
} else {
|
} else {
|
||||||
echo '<span aria-hidden="true">—</span><span class="screen-reader-text">' . _x( 'Unknown', 'name' ) . '</span>';
|
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':
|
case 'name':
|
||||||
if ( $user_object->first_name && $user_object->last_name ) {
|
if ( $user_object->first_name && $user_object->last_name ) {
|
||||||
$r .= "$user_object->first_name $user_object->last_name";
|
$r .= "$user_object->first_name $user_object->last_name";
|
||||||
|
} elseif ( $user_object->first_name ) {
|
||||||
|
$r .= $user_object->first_name;
|
||||||
|
} elseif ( $user_object->last_name ) {
|
||||||
|
$r .= $user_object->last_name;
|
||||||
} else {
|
} else {
|
||||||
$r .= '<span aria-hidden="true">—</span><span class="screen-reader-text">' . _x( 'Unknown', 'name' ) . '</span>';
|
$r .= '<span aria-hidden="true">—</span><span class="screen-reader-text">' . _x( 'Unknown', 'name' ) . '</span>';
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.9.5-alpha-42804';
|
$wp_version = '4.9.5-alpha-42805';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user