Each time a users balance is requested by a feature, the balance is passed through this filter. This could for example be used as a mean to retrieve balances from a different source then the user meta table.

Available since version 1.2

Parameters

Param

Type

Required

Description

$balance

int or float

Yes

The balance value.

$mycred

obj

No

The myCRED_Settings class object.

$user_id

int

No

The requested users ID.

$type

string

No

The point type being requested.

Used By

Package

Prio.

Description

Not used by any built-in package.

Example

Example 1: Load balances that exist in a separate database table and not in the user meta table.

myCRED Donations

Donate via PayPal

Donate Bitcoin

3LVrDPjgTkPfqGARXwAZW9cJBQEYo4FHsB

Suggest Codex Example

You can submit suggestions for codex examples that you have available as a public gist. If you are a member on the mycred.me website, you can earn Tokens for each submission. To claim these Tokens, make sure you provide your mycred.me username.

Gist URL

mycred.me Username

Please make sure the example you submit is relevant and if you include documentation, it's provided in English.