[wp-hackers] get_users() function
scribu
scribu at gmail.com
Fri Dec 11 22:30:37 UTC 2009
get_users() would be a good ideea for 3.0, considering the merging with MU
and all.
One key criteria this function must have is the ability to get users by
role.
The function itself will probably call WP_User_Search internally.
So here's a related ticket:
http://core.trac.wordpress.org/ticket/10781
On Sat, Dec 12, 2009 at 12:12 AM, Mohammad Jangda <batmoo at gmail.com> wrote:
> Are there any plans to add a get_users-like function to allow
> easy retrieval of users based on different criteria? I've seen a few TODOs
> in the core code that mention plans to replace some of the SQL queries
> related to users with a get_users function but not much more than that.
>
> The closest I've found so far are the wp_user_search class and
> get_users_of_blog. The former only does a keyword style search and the
> latter doesn't have any options other than blog_id.
>
> For my specific use case (get a list of users based on a usermeta field), I
> could very easily write an SQL query, but I'd like to avoid that and stick
> to the WordPress API if at all possible. (Though, the wp_user_search class
> is pluggable, so I could potentially just override that class).
>
> It looks like this has come up before on wp-hackers (
>
> http://groups.google.com/group/wp-hackers/browse_thread/thread/7e39fec401637f7e/fcf709dd033d78d6#fcf709dd033d78d6
> ),
> but there wasn't much discussion around that message. Any thoughts on
> having
> this added to core?
>
> I don't see a trac ticket, but if people think there's value in it, I can
> add one.
>
> --
> Mohammad Jangda
> www.digitalize.ca | @mjangda <http://twitter.com/mjangda>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
--
http://scribu.net
More information about the wp-hackers
mailing list