get_users
{get_users} is used to include your desired users into the array. You have handful of parameters at your disposal.
Usage
It can use following parameters
Parameter Name | Options |
assign | Store the result(Array) to this variable |
ban | Check user ban status:
|
category | Specific category users. Multiple categories should be separated with comma ‘,’:
|
count_only | Set to true if you only want to count result:
|
date_span | Get users for specific time frame:
|
Get user of provided email:
| |
exclude | Exclude user from result:
|
featured | Get featured users:
|
gender | Get users of specific gender:
|
level | Get users of specific level:
|
limit | Number of results you want:
|
order | Sort your result. You also need to tell how to order your result. asc OR desc, e.g ‘username desc’
|
status | Check your user status:
|
userid | Get user of provided ID:
|
username | Get user of provided username:
|
Examples
Example 1
Above code will get users of current month but only those with status of “Ok” and order according to their date-of-joined from oldest to latest. Function returned an array which is stored in {$month_users} variable. Time to loop through array and display our users.
[post_link id=”199″] and [post_link id=”237″]
Example 2
This code will get 1 featured user randomly out of all featured users. To display see following code
Last updated