Skip to content

Instantly share code, notes, and snippets.

@gabrielmerovingi
Created August 2, 2017 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabrielmerovingi/802c12072533af848ee700bea6ce9baa to your computer and use it in GitHub Desktop.
Save gabrielmerovingi/802c12072533af848ee700bea6ce9baa to your computer and use it in GitHub Desktop.
Pretend users that are exempt from being charged can afford to send new messages even if their balance is zero.
/**
* Pretend User Can Afford
* Pretend users that are exempt from being charged can afford to send
* new messages even if their balance is zero.
* @version 1.0
*/
function mycred_pro_pretend_user_can_afford( $can_afford ) {
$user_id = bp_loggedin_user_id();
// If user has a certain capability, pretend they can afford things
if ( user_can( $user_id, 'edit_users' ) )
return true;
return $can_afford;
}
add_filter( 'mycred_bp_charge_can_afford', 'mycred_pro_pretend_user_can_afford' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment