This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Change Woo Rewards Log | |
* @version 1.0 | |
*/ | |
function mycred_pro_adjust_woo_rewards_log( $log_entry = '' ) { | |
return 'Store Purchase Reward'; | |
} | |
add_filter( 'mycred_woo_reward_log', 'mycred_pro_adjust_woo_rewards_log' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Enforce Maximum | |
* Make sure users can not earn more than 1000 points. | |
* @version 1.0 | |
*/ | |
function mycred_enforce_max_balance( $run, $request, $mycred ) { | |
extract( $request ); | |
// The maximum balance a user can have |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Disable Total Balance Updates | |
* @version 1.0 | |
*/ | |
function mycred_pro_disable_total_balanace_update( $value = NULL, $object_id, $meta_key, $meta_value, $prev_value ) { | |
if ( $meta_key == 'mycred_default_total' ) | |
return true; | |
return $value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stop_current_time( get_current_dimention() ); | |
while ( have_tasks() ) { | |
assign_task_to_dimention( the_task() ); | |
} | |
do { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Delete Old Entries | |
* Uses the daily myCRED cron job "mycred_cron_reset_key" to | |
* delete entries that are older than a given time each day | |
* @version 1.0 | |
*/ | |
function mycred_pro_delete_old_entries() { | |
// The maximum age a log entry can have in seconds | |
// Example 3 months |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mycred_pro_bp_profile_balance( $output, $balance_template, $buddypress_module ) { | |
if ( ! mycred_is_admin() ) | |
return ''; | |
return $output; | |
} | |
add_filter( 'mycred_bp_profile_header', 'mycred_pro_bp_profile_balance', 10, 3 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Custom transfer Fees | |
* Charge a custom fee based on a users myCRED rank when making | |
* a transfer in myCRED. | |
* @version 1.0 | |
*/ | |
function mycred_pro_transfer_fee_by_rank( $fee, $amount, $user_id, $point_type, $prefs ) { | |
// Make sure the rank add-on is enabled to prevent crashes | |
if ( ! function_exists( 'mycred_get_rank_object_id' ) ) return $fee; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Custom transfer Fees | |
* Charge a custom fee based on a users WordPress role when making | |
* a transfer in myCRED. | |
* @version 1.0 | |
*/ | |
function mycred_pro_transfer_fee_by_role( $fee, $amount, $user_id, $point_type, $prefs ) { | |
// if we are just a subscriber, impose 10% fee | |
if ( ! user_can( $user_id, 'publish_posts' ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Bonus Points | |
* Give users bonus points when they buy points using buyCRED | |
* based on their rank. Required us to know the Rank post ID for comparisons. | |
* @version 1.0 | |
*/ | |
function mycred_pro_buycred_bonus( $run_this, $mycred ) { | |
// Only applicable for point purchases via buyCRED and if the Ranks add-on is enabled | |
if ( substr( $run_this['ref'], 0, 15 ) != 'buy_creds_with_' || ! function_exists( 'mycred_get_users_rank_id' ) ) return $run_this; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Preselect Transfer Recipient | |
* Generates a dropdown menu of transfer recipients that has been | |
* set in the mycred_transfer shortcode by providing a comma separated list of | |
* ids for the pay_to shortcode attribute. | |
* @since 1.0 | |
* @version 1.0 | |
*/ | |
function mycred_pro_pre_selected_transfer_recipients( $field, $settings, $atts ) { |