mycred_rankings_position

Codex / / Functions / mycred_rankings_position

Navigation:

  1. Description
  2. Usage
  3. Parameters
  4. Example
  5. Return

Description

Returns a given user’s position (ranking) on the leaderboard, with the user who has the largest amount of points on your website having ranking 1.

Not to be confused with the Ranks you can create though the Rank add-on.

 

Usage

<?php mycred_rankings_position( $user_id ); ?>

 

Parameters

  • user_id (int)
    Required user id.

 

Example

Example 1: .

$user_id = get_current_user_id();
echo 'Your current ranking: #' . mycred_rankings_position( $user_id );

 

Return

Returns users position (int) else empty string.

Last edited July 2, 2014