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 | |
// --------------------------------------------- | |
// FORCE THE DISPLAY_NAME USER VARIABLE TO BE THEIR FIRST NAME | |
// --------------------------------------------- | |
function rol_set_display_name( $display_name ) { | |
// New user via WP Admin > Users > Add New | |
// Edit user's name via WP Admin > Users > edit user | |
// Edit user's name via WP Admin > MemberPress > Members > edit user | |
if ( isset( $_POST['first_name'] ) ) { |
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 | |
//Integrates MemberPress with https://wordpress.org/plugins/invisible-recaptcha/ | |
//This is untested code ATM | |
function add_invisible_recaptcha_mepr_signup($membership_ID) { | |
?> | |
<div class="mp-form-row mepr_invisible_recaptcha"> | |
<?php do_action('google_invre_render_widget_action'); ?> | |
</div> | |
<?php | |
} |
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 // Set up a custom page template in your theme, and choose that template for your MemberPress thank-you page. The following should be in that template. | |
if(isset($_GET['trans_num']) && ($txn = MeprTransaction::get_one_by_trans_num($_GET['trans_num']))): | |
?> | |
<img src="http://AFFILIATE-SITE.com/index.php?plugin=wafp&controller=transactions&action=track&amount=<?php echo $txn->amount; ?>&order_id=<?php echo $txn->id; ?>&prod_id=<?php echo $txn->product_id; ?>" width="1px" height="1px" style="display: none;" /> | |
<?php endif; ?> |
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
SELECT l.name AS `name`, | |
l.id AS `id`, | |
IFNULL(g.name, 'None') AS `group`, | |
l.group_id AS `group_id`, | |
( | |
SELECT COUNT(*) | |
FROM wp_prli_clicks AS c | |
WHERE c.link_id = l.id | |
) AS `clicks`, | |
( |
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 mepr_sync_user_pro_visibility($txn, $status = false) { | |
global $userpro; | |
if(class_exists('MeprUser')) { | |
$user = new MeprUser($txn->user_id); | |
//Make sure it's a valid user still | |
if(!isset($user->ID) || !$user->ID) { return; } |
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 | |
//PASTE THE CODE BELOW THIS LINE INTO A PLUGIN LIKE My Custom Functions | |
function update_offline_desc($desc, $obj, $first) { | |
if(strpos($desc, 'offline')) { | |
//Use double quotes in your message, do not use any single quotes in your message. | |
$desc = 'PUT YOUR OWN MESSAGE IN HERE'; | |
} | |
return $desc; | |
} |
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 disable_reminders_for_sub_accounts($disable_email, $reminder, $usr, $prd) { | |
global $wpdb; | |
$q = "SELECT COUNT(*) FROM {$wpdb->prefix}mepr_corporate_accounts WHERE user_id = {$usr->ID}"; | |
$count = $wpdb->get_var($q); | |
if(!$count) { | |
$disable_email = true; | |
} |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Test Access</title> | |
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.1.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
var settings = { | |
async: true, |
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 | |
if(class_exists('MeprUtils')) { | |
$user = MeprUtils::get_currentuserinfo(); | |
if($user !== false && isset($user->ID)) { | |
//Returns an array of Membership ID's that the current user is active on | |
//Can also use 'products' or 'transactions' as the argument type | |
$active_prodcuts = $user->active_product_subscriptions('ids'); | |
if(!empty($active_prodcuts)) { |
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 | |
//Capture a new member signup. Only ever triggers once for each new member. | |
//Does not trigger for exising members who have subscribed to a Membership before. | |
// | |
//The user may not be logged in when this is called | |
//as it is triggered when a user is added over the REST API, | |
//and also when a user is added from the dashboard (MemberPress -> Members -> Add New) | |
function mepr_capture_new_member_signup_completed($event) { | |
$user = $event->get_data(); | |
$txn_data = json_decode($event->args); |