Description

This filter allows you to stop a private message from being sent and instead trigger the “Insufficient Funds” message. Used by the UserPro Private Messaging hook.

Available since version 1.1.3

Parameters
Param Type Required Description
$response bool Yes

Return TRUE to stop the message else FALSE.

$from int No

The numeric ID of the user sending the message.

$to int No

The numeric ID of the message recipient.

$hook obj No

The hook object.

Used By
Package Prio. Description
Not used by any built-in package.
Description

This filter allows you to adjust the message a user sees in the chat window when they have run out of funds. Used by the UserPro Private Messaging hook.

Available since version 1.1.3

Parameters
Param Type Required Description
$message string Yes

The message to show users. Defaults to “Insufficient Funds” wrapped in a div element to be shown as a warning message.

$from int No

The numeric ID of the user sending the message.

$to int No

The numeric ID of the message recipient.

$hook obj No

The hook object.

Used By
Package Prio. Description
Not used by any built-in package.
Example

Example 1: Display a custom message with a link to users when they run out of funds (assuming you charge users for sending messages).

Description

The myCRED for UserPro plugin provides a custom hook that allows you to reward or charge your users for sending private messages using the Private Messages for UserPro plugin.

You can use the mycred_userpro_insufficient filter to adjust the message the user sees if they run out of points and can not send messages.

Available since version 1.1.3

Known Issues

Requires version 4.9 of the Private Messages for UserPro plugin.

Setup

If you want to reward your users with points for sending / receiving messages, make sure you set a point value other than zero to enable the hook and make sure you have provided a log entry template.

If on the other hand you want to charge your users, make sure you set a negative value for sending messages. Make sure you also tick the “Prohibit users with zero points from sending messages.” checkbox! If you do not tick this checkbox, a user will be able to continue to submit new messages and gain a negative balance!

If a user can not afford to send further messages, they will see an error message in the chat window and the “Send Message” buttons will be hidden.

Supported Instances
Instance Reference Description
new_message Give or take points from users for sending or receiving a new message.
Description

The myCRED for UserPro plugin provides a custom hook that allows you to reward your users with points for getting their account verified or losing their account verification.

Available since version 1.0

Known Issues

This hook requires UserPro version 4.8 or higher.

Setup

Make sure you set a point value other than zero to enable the hook and make sure you have provided a log entry template.

Supported Instances
Instance Reference Description
verification Give or take points from users for getting their account verified.
unverification Give or take points from users for losing their account verification.
Description

The myCRED for UserPro plugin provides a custom hook that allows you to reward your users with points for following other users and/or rewarding users for getting followers.

You can select to reward everyone or limit this feature only to accounts that are verified.

Available since version 1.0

Known Issues

This hook requires UserPro version 4.8 or higher.

Setup

Make sure you set a point value other than zero to enable the hook and make sure you have provided a log entry template. You can select to either reward the the user selecting to follow someone and/or the user that gets to be followed. If you do not want to reward a particular instance, make sure that instance is set to reward zero points.

Supported Instances
Instance Reference Description
follow_user Give or take points from users for following someone else.
new_follower Give or take points from users for gaining a follower.
unfollow_user Give or take points from users for unfollowing someone they used to follow.
lost_follower Give or take points from users for losing a follower.
Description

The “Points for Publishing Content” hook reward users with points for publishing content. This act is rewarded when a posts status transitions from an “old status” to a “new status”.

The old status would include: drafts, pending for approval and scheduled post statuses. The new statuses include: published and privately published post statuses.

Any custom post statuses needs to be added in here if the status indicates content that is “published”. If your custom post status is a different type of “not published content” indicator, e.g. “Pending Approval”, the status need to be added using the mycred_publish_hook_old filter instead!

Available since version 1.6

Parameters
Param Type Required Description
$new_statuses array Yes

An array of statuses a post needs to transition to. By default these are: publish and private.

$post_id int No

The post objects ID.

$point_type string No

The point type key currently being processed.

Used By
Package Prio. Description
Not used by any built-in package.
Example

Example 1: Add a custom “Archived“ post status to the “Points for publishing content“ hook in myCRED.

Description

The “Points for Publishing Content” hook reward users with points for publishing content. This act is rewarded when a posts status transitions from an “old status” to a “new status”.

The old status would include: drafts, pending for approval and scheduled post statuses. The new statuses include: published and privately published post statuses.

Any custom post statuses needs to be added in here if the status is used BEFORE the content is published. If your custom post status is a different type of “published content” indicator, e.g. “Archived”, the status need to be added using the mycred_publish_hook_new filter instead!

Available since version 1.6

Parameters
Param Type Required Description
$old_statuses array Yes

An array of statuses a post needs to transition from. By default these are: new, auto-draft, draft, private, pending and future.

$post_id int No

The post objects ID.

$point_type string No

The point type key currently being processed.

Used By
Package Prio. Description
Not used by any built-in package.
Example

Example 1: Add a custom “Pre Approved“ post status to the “Points for publishing content“ hook in myCRED.

Description

This filter allows you to make adjustments to the button the Sell Content add-on renders for users who have not purchased access to content set for sale. You can for example use this filter to adjust the button elements attributes or customize the button label.

Available since version 1.7

Parameters
Param Type Required Description
$button string Yes

The HTML button element.

$post obj No

The WordPress post object that this button is being rendered for.

$setup array No

An associated array of the point type setup. This is the values set in the Sell Content add-ons settings for a particular point type. Note that if multiple point types are allowed to be used as payment, this settings might differ.

$mycred obj No

The myCRED_Settings object currently being used.

Used By
Package Prio. Description
Not used by any built-in package.
Example

Example 1: Insert an icon into the buttons label.

Description

This filter allows you to adjust the log entry myCRED adds with each WooCommerce store reward payout.

Available since version 1.0

Parameters
Param Type Required Description
$log_template string Yes

The log template to use.

$order_id int No

The WooCommerce order ID.

$point_type string No

The point type key, representing the point type the user is paid.

Used By
Package Prio. Description
Not used by any built-in package.
Example

Example 1: Basic Usage

/**
 * Change Woo Reward Template
 * @version 1.0
 */
function mycred_pro_adjust_woo_reward_log( $log_template, $order_id ) {

	return sprintf( 'Reward for your sore order #%d', $order_id );

}
add_filter( 'mycred_woo_reward_log', 'mycred_pro_adjust_woo_reward_log', 10, 2 );
Description

Used by the central banking service in the Banking add-on, this filter allows you to inform the add-on which references it should ignore. By default, transfers and interest payouts are ignored by the central bank, preventing large number of log entries to be saved with each event.

Available since version 1.5.2

Parameters
Param Type Required Description
$references array Yes

An Array of references that should be ignored by the central bank. Defaults to: interest, recurring_payout and transfer.

Used By
Package Prio. Description
Not used by any built-in package.
Example

Example 1: Add the custom reference “gift“ to the list.

function mycred_pro_add_bank_exception( $references ) {

	$references[] = 'gift';
	return $references;

}
add_filter( 'mycred_central_banking_ignore', 'mycred_pro_add_bank_exception' );
Description

This filter allows you to add, replace or remove templates for the Scratch Card add-on.

Available since version 1.0

Parameters
Param Type Required Description
$templates array Yes

An associative array of available templates. You can read more about this in the Scratch Card documentation.

Used By
Package Prio. Description
Not used by any built-in package.
Example

Example 1: Add a custom template from a theme.

Example 2: Add a custom template from a plugin.

Description

This filter allows you to adjust the JavaScript variables for the Notifications Plus script. You can use this to make adjustments to the notifications before they are rendered or adjust the add-on settings.

Available since version 1.3.6

Parameters
Param Type Required Description
$args array Yes

Associative array of arguments.

$module obj No

The myCRED Notifications Plus module object.

Used By
Package Prio. Description
Not used by any built-in package.
Example

Example 1: Disable front end debugging for administrators.

Description

This hook allows you to reward your users points for making referrals using the AffiliateWP plugin. You can select to reward users for signing up as an affiliate, referring signups on your website or referring WooCommerce store sales.

Available since version 1.6

Known Issues

This hook will not be visible if AffiliateWP is not enabled.

Setup

Make sure you set a point value other than zero for the instances that you want to use. For the store referral instance, please see the guide below.

Store Referrals

When it comes to rewarding store referrals, the hook offers three options:

Set Amount

This is the default option and it will reward / deduct a set amount for all referrals no matter the order amount.

If you have multiple point types setup, you can select to enable this option for any number of types.

Point Stores

If your store has been setup to use points as it’s currency, you can select this option in order to reward a percentage of the order amount to the user that made the referral.

In order to use this option, we must set AffiliateWP to use the same point type that you set your store to use. Before we can do that, we first need to set a unique currency code for our point type. This is the only way that AffiliateWP can display points as a currency. By default the MYC code is used which is not used by any real currency but if you have customized this in your store, you need to add this custom code here as well. For most users this should be left as is.

This option can not be used multiple times! If you have multiple point types setup, this hook can only be enabled for the point type your store is setup to use.

Exchange Rate

If your store is using a real currency and AffiliateWP is setup to use the same currency, you can select this option in order to convert users commissions into their point value using an exchange rate. This exchange rate is then applied to the commission amount and paid out in points.

If you have multiple point types setup and wish to reward more than one type for each commission, you can do so by enabling the hook for all point types you want to pay out. Just make sure they are all set to use this option for store referrals, the exchange rate, log template can of course be different if you want.

Refunds

When a store commission is undone, e.g. the commission’s status is changed from “Paid” to anything else, the hook will undo the payment it made when the commission was originally paid out. If however a commission has not been paid out and is undone, the hook will take no action.

Supported Instances
Instance Reference Description
affiliate_signup Give or take points from users for becoming an affiliate.
affiliate_visit_referral Give or take points from users for referring site visits.
affiliate_referral Give or take points from users for earning a commission in a store sale.
affiliate_referral_refund Give or take points from users for a store sale commission being refunded.
Description

This hook allows you to reward your users for rating content on your website using the WP-PostRatings plugin. You can select to reward the user making the rating or the content author that is receiving the rating.

As of version 1.6 you can select to reward a specific amount or reward the rating amount (1-5).

Available since version 1.5

Known Issues

This hook will not be visible if WP-PostRatings is not enabled.

Setup

Make sure you set a point value other than zero to enable the hook and make sure you have provided a log entry template. You can select to just reward the user making the rating and/or the post content author for getting their content rated.

Supported Instances
Instance Reference Description
post_rating Give or take points from users for rating content.
post_rating_author Give or take points from content authors for receiving a rating.
Description

This hook allows you to reward your users with points for adding or removing “favorite posts” that are managed by the WP Favorite Posts plugin. You can select to reward the user that adds / removes a post from their Favorites, and/or the post author for getting their post added to someone’s “Favorites”.

Available since version 1.1

Known Issues

This hook will not be visible if WP Favorite Posts is not enabled.

Users can only get points once for each post their add to their favorites. If a user removes the post and adds it again, the hook will not reward further actions.

Setup

Make sure you set a point value other than zero to enable the hook and make sure you have provided a log entry template.

Supported Instances
Instance Reference Description
add_favorite_post Give or take points from users for adding a post to their "Favorites".
favorited_post Give or take points from post authors that get their posts added to someone's "Favorites".
favorite_post_removed Give or take points from users for removing a post from their "Favorites".
favorite_post_removal Give or take points from post authors that get their posts removed from someone's "Favorites".
Description

This hook allows you to reward your users for posting forum topics and posts using the Simple:Press forum plugin.

Available since version 1.3.3

Known Issues

This hook will not be visible if Simple:Press is not enabled.

Setup

Make sure you set a point value other than zero to enable the hook and make sure you have provided a log entry template.

Supported Instances
Instance Reference Description
new_forum_topic Give or take points from users for creating a new forum topic.
deleted_topic Give or take points from users for having a forum topic deleted.
new_topic_post Give or take points from users for creating a new forum post.
deleted_topic_post Give or take points from users for having a forum post deleted.