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
/* | |
Keep members start dates at checkout, even if switching levels. | |
*/ | |
function custom_pmpro_checkout_start_date($date, $user_id, $level) | |
{ | |
global $wpdb; | |
// Comment this out if you want to use the users registration date (Warning: Registration date may not contain data...) | |
$sqlQuery = "SELECT UNIX_TIMESTAMP(startdate) FROM $wpdb->pmpro_memberships_users WHERE user_id = '" . esc_sql($user_id) . "' ORDER BY id LIMIT 1"; | |
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: PMPro Directory Customization | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Show all PMPro Users in directory (regardless of status). | |
Version: .1 | |
Author: Thomas Sjolshagen @ Stranger Studios <thomas@eighty20results.com> | |
Author URI: http://www.strangerstudios.com | |
*/ |
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 | |
/* | |
Use PMPro Register Helper to add PMPro Billing Address fields to the edit user page for admins. | |
*/ | |
function my_show_pmpro_address_fields_in_profile() | |
{ | |
//require PMPro and PMPro Register Helper | |
if(!defined('PMPRO_VERSION') || !defined('PMPRORH_VERSION')) | |
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 | |
function my_add_pmpro_RH_fields() | |
{ | |
//require PMPro and PMPro Register Helper | |
if (!defined('PMPRO_VERSION') || !defined('PMPRORH_VERSION')) | |
return; | |
$fields = array(); | |
$fields[] = new PMProRH_Field( | |
"first_name", // Input name, will also be used as the key to access as user meta |
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: Additional Checkout Fields (PMPro Register Helper) | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Additional Checkout page & profile fields for the Paid Memberships Pro Register Helper add-on | |
Version: .1 | |
Author: Thomas Sjolshagen @ Stranger Studios <thomas@eighty20results.com> | |
Author URI: http://www.strangerstudios.com | |
*/ | |
function my_add_pmpro_RH_fields() |
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: Additional Checkout Fields (PMPro Register Helper) | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Additional Checkout page & profile fields for the Paid Memberships Pro Register Helper add-on | |
Version: .1 | |
Author: Thomas Sjolshagen @ Stranger Studios <thomas@eighty20results.com> | |
Author URI: http://www.strangerstudios.com | |
*/ | |
function my_add_pmpro_RH_fields() |
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 | |
/* | |
Add birthday to user signup and check that user is between 13-17. | |
Will not work with PayPal Standard or PayPal Express. | |
*/ | |
//birthday fields | |
function my_pmpro_checkout_after_user_fields() | |
{ | |
$current_day = date("j"); |
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 restrict_email($value) | |
{ | |
$email = $_REQUEST['bemail']; | |
if(is_invalid($email)) | |
{ | |
global $pmpro_msg, $pmpro_msgt; | |
//TODO: Set the error text to be whatever you want it to be: |
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
function pmpro_loadTemplate($page_name = null, $type = 'pages', $ext = 'php' ) | |
{ | |
// called from page handler shortcode | |
if (is_null($page_name)) | |
{ | |
global $pmpro_page_name; | |
$page_name = $pmpro_page_name; | |
} | |
// template paths in order of priority (array gets reversed) |
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 | |
/* | |
* Hide some levels from Levels page | |
*/ | |
function my_pmpro_levels_array($levels) { | |
global $current_user; | |
// if the user is logged in | |
if (!empty($current_user->ID)) |