Tag: function

Codex / function

mycred_add

Package: mycred/balance Category: Functions

Adds a given amount of creds to a specific user. Once the users balance has been updated, a new log entry is made under the given reference.

Navigation: Description Usage Parameters Return Description This function allows you to add a new notification for a specific user. Notifications are shown when the user logs in (if the notice is generated when they are not online) or on the next page reload (if they are logged in). Usage $notice = array( ‘user_id’ => 1, […]

Checks if a given user should be excluded. These are either users who are in the exclude list or if “Exclude Plugin Editors” or “Exclude Creds Editors” are set to true.

This function will query all published ranks to see where the given user fits in. If requested, the found rank is saved for the given user.

Counts the total amount of points that has been entered into the log between two given UNIX timestamps. Optionally you can restrict counting to a specific user or specific reference (or both).

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.

Removes a given amount of creds from a specific user. Once the users balance has been updated, a new log entry is made under the given reference.

Checks if a user can make a transfer. Checks to make sure the users balance is not zero and if the user has reached the transfer limit (if used).