From ee126ed80329171f479bc94244780417c6a2369a Mon Sep 17 00:00:00 2001 From: westi 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: http://svn.automattic.com/wordpress/trunk@9344 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 e0e0f8b09..9af3b02a7 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 .= "";