mycred_get_users_cred

Codex / mycred/balance / Functions / mycred_get_users_cred

Navigation:

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

Description

This function returns a given user’s current point balance without any prefix or suffix (if used). Use mycred_get_users_fcred to return the same result but with prefix and/or suffix.

 

Usage

<?php echo mycred_get_users_cred( $user_id, $type ); ?>

 

Parameters

  • user_id (int) required
    Required user id.
  • type (string)
    Optional cred id.

 

Example

Example 1: Get current users balance.

echo 'Your currently have ' . mycred_get_users_cred() . ' points.';

 

Return

Returns unformatted integer or float.

Last edited March 5, 2016