Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#14118 closed enhancement (wontfix)

Get user IDs by meta-data

Reported by: filosofo's profile filosofo Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Users Keywords: has-patch
Focuses: Cc:


There should be some way to retrieve user IDs from user meta-data, without having to query the database directly.

Patch adds function get_users_by_metadata:

array get_users_by_metadata ( string $meta_key [, string $meta_value ] )

So, for example, you can do things like:

$my_user_ids = get_users_by_metadata( 'openid', '');

or perhaps

$campaign_referrals = get_users_by_metadata( 'signup_from_ad_campaign' );

Attachments (1)

get_users_by_metadata.14118.diff (1.1 KB) - added by filosofo 14 years ago.

Download all attachments as: .zip

Change History (8)

#1 @scribu
14 years ago

  • Keywords dev-feedback added
  • Milestone changed from 3.1 to Future Release

I think we should go for a more general get_users() function, similar to get_posts().

#2 @scribu
14 years ago

Or a more general get_objects_by_meta() that works on any meta table, for that matter.

#3 @filosofo
14 years ago

I like either of those ideas. Will you create a patch?

#4 @scribu
14 years ago

I'll take a shot at get_users().

#5 @filosofo
14 years ago

  • Keywords dev-feedback removed
  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

OK, great. Looking forward to it.

#7 @scribu
14 years ago

Opened #14123.

Note: See TracTickets for help on using tickets.