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
/** | |
* Manual Badge Reference | |
* @version 1.0 | |
*/ | |
add_filter( 'mycred_all_references', 'mycred_pro_manual_badge' ); | |
function mycred_pro_manual_badge( $references ) { | |
$references['disabled_feature'] = 'Badge is manually awarded'; | |
return $references; |
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
<?php | |
/** | |
* Plugin Name: myCRED User Awarded | |
* Plugin URI: http://www.birminghamiu.co.uk | |
* Description: Display the total current users myCRED awarded and lost points in front end. | |
* Version: 1.0 | |
* Author: G. Lloyd | |
* Author URI: http://www.birminghamiu.co.uk | |
* License: Copyrighted | |
* |
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
/** | |
* WP Courseware Hook | |
* @version 1.0.2 | |
*/ | |
add_filter( 'mycred_setup_hooks', 'mycred_register_courseware_hook' ); | |
function mycred_register_courseware_hook( $installed ) { | |
$installed['courseware'] = array( | |
'title' => 'WP Courseware', | |
'description' => 'Award or deduct %plural% for users completing WP Courseware courses, modules or units.', | |
'callback' => array( 'myCRED_Hook_CourseWare' ) |
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
/** | |
* WP Postviews Hook | |
* @version 1.0 | |
* @author Gabriel S Merovingi | |
*/ | |
add_filter( 'mycred_setup_hooks', 'register_wp_postviews_hook_in_mycred' ); | |
function register_wp_postviews_hook_in_mycred( $installed ) { | |
$installed['wp_postviews'] = array( | |
'title' => __( 'WP Postviews', 'textdomain' ), |
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
<?php | |
// Get user's rank progress | |
function get_mycred_users_rank_progress( $user_id, $show_rank ) { | |
global $wpdb; | |
if ( ! function_exists( 'mycred' ) ) return ''; | |
// Change rank data to displayed user when on a user's profile | |
if ( function_exists( 'bp_is_user' ) && bp_is_user() && empty( $user_id ) ) { |
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
/** | |
* Limit BP Group Creation | |
* Only users with x amount of points can create groups. | |
* @version 1.0 | |
*/ | |
add_filter( 'bp_user_can_create_groups', 'mycred_pro_limit_bp_group_creation' ); | |
function mycred_pro_limit_bp_group_creation( $can ) { | |
if ( ! function_exists( 'mycred' ) ) return $can; |
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
/** | |
* Exclude Subscribers | |
* Excludes any user that does not have the "edit_posts" capability. | |
* On a default WordPress installation this will exclude all users with the | |
* "Subscriber" role. | |
* For more information on roles and capabilities please consult the | |
* WordPress codex: http://codex.wordpress.org/Roles_and_Capabilities | |
* @version 1.0 | |
*/ | |
add_filter( 'mycred_exclude_user', 'exclude_subscriber_from_mycred', 10, 2 ); |
OlderNewer