From bfe6168186f20c60010918db6ea8cda21691b00e Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Sat, 25 Oct 2008 20:40:58 +0000 Subject: [PATCH] Make sure we always display something in the dropdown. See #7027. git-svn-id: https://develop.svn.wordpress.org/trunk@9344 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/user.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index e0e0f8b09f..9af3b02a75 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -427,7 +427,7 @@ function setup_userdata($user_id = '') { *
  • include - User IDs to include.
  • *
  • exclude - User IDs to exclude.
  • *
  • multi - Default is 'false'. Whether to skip the ID attribute on the 'select' element.
  • - *
  • show - Default is 'display_name'. User table column to display.
  • + *
  • show - Default is 'display_name'. User table column to display. If the selected item is empty then the user_login will be displayed in parentesis
  • *
  • echo - Default is '1'. Whether to display or retrieve content.
  • *
  • selected - Which User ID is selected.
  • *
  • name - Default is 'user'. Name attribute of select element.
  • @@ -493,7 +493,8 @@ function wp_dropdown_users( $args = '' ) { foreach ( (array) $users as $user ) { $user->ID = (int) $user->ID; $_selected = $user->ID == $selected ? " selected='selected'" : ''; - $output .= "\t\n"; + $display = !empty($user->$show) ? $user->$show : '('. $user->user_login . ')'; + $output .= "\t\n"; } $output .= "";