Skip to content

Instantly share code, notes, and snippets.

@gabrielmerovingi
Created February 27, 2017 14:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabrielmerovingi/29b838e585fc22a63708a97e7fb19d73 to your computer and use it in GitHub Desktop.
Save gabrielmerovingi/29b838e585fc22a63708a97e7fb19d73 to your computer and use it in GitHub Desktop.
Double all user point gains.
/**
* Duplicate Points
* @since 1.0
* @version 1.0
*/
function mycred_pro_duplicate_points( $request ) {
// If a user is to gain points, double the value
if ( $request['amount'] > 0 ) {
$request['amount'] = $request['amount'] * 2;
}
return $request;
}
add_filter( 'mycred_run_this', 'mycred_pro_duplicate_points' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment