View mycred-publish-hook-ref-filter-example1
/**
* Adjust Publish Reference
* Log the event under a unique reference based on the post type being published.
* @version 1.0
*/
function mycred_pro_publish_ref_by_type( $reference, $post ) {
return 'publish_' . $post->post_type;
}
View reward-completed-woo-orders
/**
* Reward Completed Orders
* Will give a user 1 point for each product in an order.
* @version 1.0.1
*/
function mycred_pro_reward_completed_orders( $order_id ) {
if ( ! function_exists( 'mycred' ) ) return;
$order = wc_get_order( $order_id );
View reward-mycred-payment
add_filter( 'mycred_woo_reward_mycred_payment', '__return_true' );
View mycred-history-woo-my-account
class My_Custom_My_Account_Endpoint {
/**
* Custom endpoint name.
*
* @var string
*/
public static $endpoint = 'my-custom-endpoint';
/**
View mycred-woo-reward-log-filter-example1
/**
* 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' );
View enforce-max-mycred-balance
/**
* 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
View disable-mycred-total-balance-updates
/**
* 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;
View multi-dimentional-tasking
stop_current_time( get_current_dimention() );
while ( have_tasks() ) {
assign_task_to_dimention( the_task() );
}
do {
View delete-old-mycred-entries
/**
* 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
View mycred-bp-profile-header-filter-example1
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 );