Opened 15 years ago
Closed 15 years ago
#15791 closed defect (bug) (fixed)
wp_dropdown_users ignores defaults
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 3.1 | Priority: | normal |
| Severity: | normal | Version: | 3.1 |
| Component: | General | Keywords: | has-patch |
| Focuses: | Cc: |
Description
wp_dropdown_users no longer orders results by display_name by default, because only the $args array passed to the function is used to determine which users to include.
Steps to reproduce
Have two users:
User 1: login = aaaa, display name = zzzz User 2: login = zzzz, display name = aaaa
Call wp_dropdown_users. Expect User 2 to be displayed first, but actually ordered by login.
Two patches attached, use $r in get_users call and either set default to name or allow display_name in WP_User_Query. v2 is probably more backwards compatible (raises the question of backwards compatibility of other orderby values, e.g. just "email" now instead of "user_email". Also, the codex suggests "user_nicename" as a valid orderby value, but it looks like this, or "nicename", doesn't even work with WP_User_Query).
(In [16916]) Honor defaults in wp_dropdown_users(). Props duck_. fixes #15791