[wp-hackers] WP User Query sorting

Simon Blackbourn piemanek at gmail.com
Tue Aug 6 21:17:51 UTC 2013

>  Would there be an easy way to do sorting on user meta then? Without doing
> a lot of SQL-level stuff?

I sort the results of get_users on lastname using usort - see my answer
here: http://lists.automattic.com/pipermail/wp-hackers/2012-June/043335.html

However, I'm not 100% sure that will work with a custom user meta field, so
you could also try this Stack Exchange answer which uses preg_replace on
the SQL: http://wordpress.stackexchange.com/a/98610/2877


More information about the wp-hackers mailing list