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: 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 | |
*/ |
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 | |
//This file only unsets the errors | |
//You'll still need to override the app/views/checkout/form.php file to remove the password fields HTML | |
//You can find instructions on overriding template files here: https://www.memberpress.com/1.1.7 | |
function unset_password_validation_errors($errors) { | |
if(empty($errors)) { return $errors; } //Should never happen if the password fields are hidden | |
//Unset the password field errors | |
// IF YOU'VE TRANSLATED THE PLUGIN - YOU MAY NEED TO CHANGE THESE ENGLISH TEXTS TO YOUR LANGUAGE | |
foreach($errors as $i => $v) { |
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: MemberPress Display Name | |
Plugin URI: https://memberpress.com | |
Description: Adds a Display Name field to MemberPress signup and account pages | |
Version: 1.0 | |
Author: Caseproof, LLC | |
Author URI: http://caseproof.com/ | |
Copyright: 2004-2014, Caseproof, LLC | |
*/ |
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 | |
// 1) User purchases and payment is complete | |
function capture_completed_transaction($txn) { | |
//It's possible this could be a recurring transaction for a product the user is already subscribed to so probably use a user meta field described below | |
$user = new MeprUser($txn->user_id); //A MeprUser object | |
$membership = new MeprProduct($txn->product_id); //A MeprProduct object | |
$users_memberships = $user->active_product_subscriptions('ids'); //An array of membership CPT ID's | |
//Here you may want to grab a user meta field of your own creating and check to see if the user is already subscribed to this membership or not | |
//If not, then push them to your 3rd party application and update the user meta field |
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 | |
function ends_with($haystack, $needle = '.ac.uk') { | |
return (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE); | |
} | |
function check_email_domain($errors) { | |
$membership_id = 123; //Change this to reflect your Membership ID | |
if($membership_id != $_POST['mepr_product_id']) { | |
return $errors; |
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: MemberPress Website Fields | |
Version: 1.0.0 | |
Author: Caseproof, LLC | |
Author URI: http://caseproof.com | |
Description: Allow users to enter their website URL for each subscription they purchase | |
*/ | |
//Signup form functions |
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: MemberPress + New User Approve | |
Version: 1.0.0 | |
Author: Caseproof, LLC | |
Author URI: http://caseproof.com | |
Description: Helps the flow of signups from approved/unapproved domains between the MemberPress and New User Approve plugins | |
*/ | |
function mepr_get_approved_domains() { |
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 //This code can be placed in a plugin like My Custom Functions (just omit this top line when copying) | |
function add_additional_mailchimp_usermeta($args, $contact, $list_id) { | |
$date = get_user_meta($contact->ID, 'mepr_some_date_field', true); //mepr_some_date_field SHOULD BE REPLACED WITH YOUR date field's slug | |
$args['merge_vars']['MMERGE_77'] = $date; //MMERGE_77 SHOULD BE REPLACED WITH YOUR SPECIFIC MERGE FIELD NAME | |
return $args; | |
} | |
add_filter('mepr-mailchimp-add-subscriber-args', 'add_additional_mailchimp_usermeta', 11, 3); |
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 | |
//Sample code showing how to limit the total # of signups allowed on two different memberships | |
//Also some code at the bottom to show a custom message on the signup page when limit is reached | |
//Used to check if a signup limit has been reached for a particular membership | |
function has_reached_limit($membership_id, $limit) { | |
global $wpdb; | |
$query = "SELECT count(DISTINCT user_id) | |
FROM {$wpdb->prefix}mepr_transactions |
OlderNewer