Opened 13 years ago
Closed 13 years ago
#24680 closed defect (bug) (fixed)
wp_dropdown_users references user_login attribute that is never set
| Reported by: | sphoid | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.6 |
| Component: | Users | Version: | 3.5.2 |
| Severity: | minor | Keywords: | |
| Cc: | Focuses: |
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
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Patch to add user_login to fields argument (wp-includes/user.php)