Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#15791 closed defect (bug) (fixed)

wp_dropdown_users ignores defaults

Reported by: duck_ Owned by:
Priority: normal Milestone: 3.1
Component: General Version: 3.1
Severity: normal Keywords: has-patch
Cc: Focuses:

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).

Attachments (2)

15791.diff​ (2.2 KB ) - added by duck_ 16 years ago.
15791.v2.diff​ (2.2 KB ) - added by duck_ 16 years ago.

Download all attachments as: .zip

Change History (3)

@duck_
16 years ago

@duck_
16 years ago

#1 @ryan
16 years ago

  • Resolution → fixed
  • Status new → closed

(In [16916]) Honor defaults in wp_dropdown_users(). Props duck_. fixes #15791

Note: See TracTickets for help on using tickets.