Description
This function assigns ranks for a given point type. The function will assign ranks starting with the rank that has the lowest point requirement. Used when clicking on the “Assign users to Ranks” button in the admin area.
Returns
(int) Returns the total number of users that successfully received a rank.
Parameters
Param | Type | Required | Description | |
---|---|---|---|---|
function mycred_assign_ranks( |
||||
$point_type |
string | No | The point type key. Should only be used if assigning ranks of a custom point type. |
|
) { ... } |
Example
Example 1: Default usage
$count = mycred_assign_ranks(); printf( '%d ranks were assigned.', $count );