Skip to content

Instantly share code, notes, and snippets.

@cartpauj
Last active March 15, 2018 00:59
Show Gist options
  • Save cartpauj/18a4f543af00204f4fa2 to your computer and use it in GitHub Desktop.
Save cartpauj/18a4f543af00204f4fa2 to your computer and use it in GitHub Desktop.
MemberPress + UPME integration
<?php
/*
Plugin Name: MemberPress + UPME
Plugin URI: https://memberpress.com
Description: Activates UPME profiles when a user signs up via MemberPress.
Version: 1.0
Author: Caseproof, LLC
Author URI: http://caseproof.com/
Copyright: 2004-2014, Caseproof, LLC
*/
function mepr_upme_activate($txn) {
update_user_meta($txn->user_id, 'upme_activation_status', 'ACTIVE');
update_user_meta($txn->user_id, 'upme_approval_status', 'ACTIVE');
update_user_meta($txn->user_id, 'upme_user_profile_status', 'ACTIVE');
upme_update_user_cache($txn->user_id);
}
//add_action('mepr-signup', 'mepr_upme_activate'); //Use this if you don't want to wait for completed payment
add_action('mepr-txn-status-complete', 'mepr_upme_activate'); //Use this if you want to wait for completed payment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment