diff --git src/wp-admin/user-edit.php src/wp-admin/user-edit.php
index c3c120ff37..5c553c7b2f 100644
|
|
|
if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_c |
| 421 | 421 | <th><label for="display_name"><?php _e('Display name publicly as') ?></label></th> |
| 422 | 422 | <td> |
| 423 | 423 | <select name="display_name" id="display_name"> |
| 424 | | <?php |
| 425 | | $public_display = array(); |
| 426 | | $public_display['display_nickname'] = $profileuser->nickname; |
| 427 | | $public_display['display_username'] = $profileuser->user_login; |
| | 424 | <?php |
| | 425 | $public_display = array(); |
| | 426 | $public_display['display_nickname'] = $profileuser->nickname; |
| | 427 | $public_display['display_username'] = $profileuser->user_login; |
| 428 | 428 | |
| 429 | | if ( !empty($profileuser->first_name) ) |
| | 429 | if ( ! empty( $profileuser->first_name ) ) { |
| 430 | 430 | $public_display['display_firstname'] = $profileuser->first_name; |
| | 431 | } |
| 431 | 432 | |
| 432 | | if ( !empty($profileuser->last_name) ) |
| | 433 | if ( ! empty( $profileuser->last_name ) ) { |
| 433 | 434 | $public_display['display_lastname'] = $profileuser->last_name; |
| | 435 | } |
| 434 | 436 | |
| 435 | | if ( !empty($profileuser->first_name) && !empty($profileuser->last_name) ) { |
| | 437 | if ( ! empty( $profileuser->first_name ) && ! empty( $profileuser->last_name ) ) { |
| 436 | 438 | $public_display['display_firstlast'] = $profileuser->first_name . ' ' . $profileuser->last_name; |
| 437 | 439 | $public_display['display_lastfirst'] = $profileuser->last_name . ' ' . $profileuser->first_name; |
| 438 | 440 | } |
| 439 | 441 | |
| 440 | | if ( !in_array( $profileuser->display_name, $public_display ) ) // Only add this if it isn't duplicated elsewhere |
| | 442 | // Only add this if it isn't duplicated elsewhere |
| | 443 | if ( ! in_array( $profileuser->display_name, $public_display ) ) { |
| 441 | 444 | $public_display = array( 'display_displayname' => $profileuser->display_name ) + $public_display; |
| | 445 | } |
| | 446 | |
| | 447 | /** |
| | 448 | * Filter the public display selection options. |
| | 449 | * |
| | 450 | * @param array $public_display The array of public_display options. |
| | 451 | * @param WP_User $profileuser The user whose profile is being edited. |
| | 452 | */ |
| | 453 | $public_display = apply_filters( 'user_profile_public_display', $public_display, $profileuser ); |
| 442 | 454 | |
| 443 | 455 | $public_display = array_map( 'trim', $public_display ); |
| 444 | 456 | $public_display = array_unique( $public_display ); |
| 445 | 457 | |
| 446 | 458 | foreach ( $public_display as $id => $item ) { |
| 447 | | ?> |
| 448 | | <option <?php selected( $profileuser->display_name, $item ); ?>><?php echo $item; ?></option> |
| 449 | | <?php |
| | 459 | ?> |
| | 460 | <option <?php selected( $profileuser->display_name, $item ); ?>><?php echo $item; ?></option> |
| | 461 | <?php |
| 450 | 462 | } |
| 451 | | ?> |
| | 463 | ?> |
| 452 | 464 | </select> |
| 453 | 465 | </td> |
| 454 | 466 | </tr> |