Otto-
Works like a charm. I ended up needing to add `'fields'=>'all_with_meta'`
to the array so I could use 'last_name' and 'first_name' in the return
array.
Looks like this:
$users = new WP_User_Query(array(
'meta_key'=>'last_name',
'orderby'=>'meta_value',
'fields'=>'all_with_meta'
));
Thanks,
Josh
Post by OttoPost by Josh PollockThere doesn't seem to be an orderby option in WP_User_Query to orderby
last
Post by Josh Pollockname field. This leaves me wondering why not and what the most direct way
to do so would be.
Does this not work?
new WP_User_Query(array(
'meta_key'=>'last_name',
'orderby'=>'meta_value',
));
The last name is not a field that exists in the users table. It's a meta
field. So you have to specify it and then order by the value of it.
-Otto
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers