I have wp_users
table which has a column ordering. I came to know that get_users()
returns all the users.
I am using it like get_users('orderby=ordering')
I got help form this link
But unfortunately it is not sorting on ordering column.
Any help?
You should first take a look at the users table from the database.
The command you try is good, but the argument you use for ordering might be wrong. You should order by a column from the users table, for example user name, or user id’s..
On the link you mentioned I’ve found these:
orderby – Sort by ‘ID’, ‘login’, ‘nicename’, ’email’, ‘url’, ‘registered’, ‘display_name’, or ‘post_count’.
order – ASC (ascending) or DESC (descending).
Some working examples:
Get users by nicename:
Other examples:
Display users sorted by Post Count, Descending order
Display users sorted by registered, Ascending order