Make WordPress Core

Opened 13 years ago

Closed 11 years ago

#18183 closed enhancement (duplicate)

Better WP_User_Query search

Reported by: gluten's profile gluten Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.2.1
Component: Users Keywords: has-patch
Focuses: 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 13 years ago.
Add display_name to WP_User_Query search columns

Download all attachments as: .zip

Change History (8)

@gluten
13 years ago

Add display_name to WP_User_Query search columns

#1 @gluten
13 years ago

  • Summary changed from Better get_users() search to Better WP_User_Query search

#2 @scribu
13 years ago

  • Milestone changed from Awaiting Review to 3.3

Makes sense.

#3 @scribu
13 years ago

  • Keywords has-patch commit added

#4 @scribu
13 years ago

  • Component changed from General to Users

#5 @ocean90
13 years ago

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

#6 follow-up: @Lohoris
11 years ago

  • Resolution duplicate deleted
  • Status changed from closed to reopened

I'm puzzled.

This is a necessary feature, and "it doesn't scale" isn't a valid excuse.

Either add the relevant index or... just leave it open. Doesn't make sense to close it.

#7 in reply to: ↑ 6 @johnbillion
11 years ago

  • Resolution set to duplicate
  • Status changed from reopened to closed

Replying to Lohoris:

Either add the relevant index or... just leave it open. Doesn't make sense to close it.

There's no point in leaving a ticket open that will never get fixed.

That said, this ticket is three years old. See #27304 for a newer approach which will have some dependencies on other changes to Multisite behaviour once I get around to documenting them.

Note: See TracTickets for help on using tickets.