#18183 closed enhancement (duplicate)

Better WP_User_Query search

Reported by: gluten Owned by:
Priority: normal Milestone:
Component: Users Version: 3.2.1
Severity: minor Keywords: has-patch
Cc:

Description

The get_users() function only searches 'user_login' and 'user_nicename' (when searching for a user by name). There is no way to search users by their display name. Including 'display_name' would make searching with get_users() much more intuitive, since in my experience users tend to be known by their display name and not necessarily their login. In theory I could do a meta_query for fields such as first and last name, but I can't find an easy way to query 'display_name' since it is not on the 'usermeta' table.

Attachments (1)

18183.diff (493 bytes) - added by gluten 22 months ago.
Add display_name to WP_User_Query search columns

Download all attachments as: .zip

Change History (6)

Add display_name to WP_User_Query search columns

  • Summary changed from Better get_users() search to Better WP_User_Query search
  • Milestone changed from Awaiting Review to 3.3

Makes sense.

  • Keywords has-patch commit added
  • Component changed from General to Users
  • Keywords commit removed
  • Milestone 3.3 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

This won't scale as there is no index on the column in the database, see #15170, #16620 and #16366.

Note: See TracTickets for help on using tickets.