Opened 10 years ago
Closed 10 years ago
#24680 closed defect (bug) (fixed)
wp_dropdown_users references user_login attribute that is never set
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 3.6 | Priority: | normal |
Severity: | minor | Version: | 3.5.2 |
Component: | Users | Keywords: | |
Focuses: | Cc: |
Description
When wp_dropdown_users is called and the internal foreach loop encounters as user with an empty value for the attribute indicated in $show it attempts to fallback on $user->user_login to show as the option text. When the fallback happens a php notice is triggered "Undefined property: stdClass::$user_login". By default get_users() is called with 'fields' = array('ID', $show) and by default $show is set to display_name so user_login is never an attribute of the queried users unless $show is set to user_login by some chance. I am attaching a patch that adds user_login to the fields argument
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
Patch to add user_login to fields argument (wp-includes/user.php)