This function will retrieve a given users current rank object for a specific point type. If you only need the rank post object ID, consider instead using the mycred_get_users_rank_id function instead.
(object | string) Returns either the rank object or an empty string if the user does not have a rank.
Param | Type | Required | Description | |
---|---|---|---|---|
function mycred_get_users_rank( |
||||
$user_id |
int | Yes | The numeric ID of the user. |
|
$point_type |
string | No | The point type key to return a rank for. Should only be used when you have ranks setup for more than one point type. |
|
) { ... } |
Example 1: Get a users rank object.