Opened 21 months ago

Closed 5 months ago

#18581 closed defect (bug) (wontfix)

get_user codex said thet meta_keys could be used in 'fields' - sql error

Reported by: anmari Owned by:
Priority: normal Milestone:
Component: Users Version: 3.2.1
Severity: trivial Keywords:
Cc:

Description

The codex entryhttp://codex.wordpress.org/Function_Reference/get_users#Parameters said that the fields argument would accept meta_keys.

However in 3.2.1 and 3.3 using meta_keys gives a sql error.
Using normal user table fields is fine.

I have corrected the codex for now, but in case this was really intended functionality, thought I better log it too.

Attachments (1)

db_error.png (6.0 KB) - added by anmari 21 months ago.
sql error

Download all attachments as: .zip

Change History (4)

sql error

comment:1 follow-up: ↓ 2   dd3221 months ago

Looking at the function, it doesn't appear that it's ever supported meta keys in the fields param, The field selected is always prefixed with the users table. It looks like the documentation is simply wrong to me.. The functions it replaced might have however accepted meta keys..

comment:2 in reply to: ↑ 1   SergeyBiryukov21 months ago

Replying to dd32:

The functions it replaced might have however accepted meta keys..

get_users() replaced get_users_of_blog(), however that function didn't accept meta keys either.

So should WP_User_Query be updated to allow meta keys in the fields parameter, or, now that the documentation is corrected, this ticket can be closed?

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Since WP_User_Query returns magical WP_User objects with which you can access any custom field, I don't think this is needed.

Note: See TracTickets for help on using tickets.