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
/** | |
* Adjust myCRED Point Rewards | |
* Will move the points payout from when an order is "paid" to when | |
* an order is "completed". | |
* @version 1.0 | |
*/ | |
add_action( 'after_setup_theme', 'mycred_pro_adjust_woo_rewards', 110 ); | |
function mycred_pro_adjust_woo_rewards() { | |
remove_action( 'woocommerce_payment_complete', 'mycred_woo_payout_rewards' ); |
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
/** | |
* Register Custom Hook | |
* @since 1.0 | |
* @version 1.0 | |
*/ | |
add_filter( 'mycred_setup_hooks', 'mycred_pro_register_view_content_category_hook' ); | |
function mycred_pro_register_view_content_category_hook( $installed ) { | |
$installed['view_category_content'] = array( | |
'title' => __( '%plural% for Viewing Content (Categories)', 'mycred' ), |
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
/** | |
* Render Shortcodes in Notifications | |
* @version 1.0 | |
*/ | |
function mycred_pro_render_shortcodes_in_notice( $notice ) { | |
return do_shortcode( $notice ); | |
} | |
add_filter( 'mycred_notifications_note', 'mycred_pro_render_shortcodes_in_notice' ); |
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
/** | |
* Register Custom BP Notifications | |
* Inform BuddyPress about our custom myCRED related notifications. | |
* @since 1.0 | |
* @version 1.0 | |
*/ | |
function mycredpro_register_custom_bp_notifications() { | |
buddypress()->mycred_notifications = new stdClass; | |
buddypress()->mycred_notifications->notification_callback = 'mycredpro_render_bp_notification'; |
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
/** | |
* Prevent Negative Balances | |
* Make sure users can never get a negative balance. Will allow users | |
* to gain a zero balance. | |
* @since 1.0 | |
* @version 1.0 | |
*/ | |
add_filter( 'mycred_add', 'mycred_pro_no_negative_balance', 999, 2 ); | |
function mycred_pro_no_negative_balance( $reply, $request ) { |
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
/** | |
* Shortcode: Take Points | |
* This custom shortcode allows you to take points from your users when they | |
* click on the button this shortcode generates. Supports optional confirmation message. | |
* @version 1.0.2 | |
*/ | |
add_shortcode( 'mycred_take', 'mycred_pro_render_take_shortcode' ); | |
function mycred_pro_render_take_shortcode( $atts, $label = 'Give Away' ) { | |
extract( shortcode_atts( array( |
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
/** | |
* Step 1 - Add new ticket preference | |
* In this example we will insert this under "Participation" section | |
* of the lottery edit screen. | |
* @version 1.0 | |
*/ | |
add_action( 'mycred_edit_lotto_participation', 'add_max_lottery_entries_settings' ); | |
function add_max_lottery_entries_settings( $lottery ) { | |
$tickets = get_post_meta( $lottery->id, '_tickets', true ); ?> |
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
/** | |
* Add Custom Email Instances | |
* First we add in our custom instances so we can select them when we create | |
* a new email notice. | |
* @version 1.0 | |
*/ | |
add_filter( 'mycred_email_instances', 'mycred_pro_add_milestone_email_instances' ); | |
function mycred_pro_add_milestone_email_instances( $instances ) { | |
$instances['accountnum'] = array( |
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
/** | |
* Register Custom myCRED Hooks | |
* @since 1.0 | |
* @version 1.0 | |
*/ | |
add_filter( 'mycred_setup_hooks', 'mycred_pro_register_publishposttype_hook' ); | |
function mycred_pro_register_publishposttype_hook( $installed ) { | |
$installed['publish_posttypes'] = array( | |
'title' => 'Publishing Post Types', |
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 |
NewerOlder