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 lines 5 onwards to your custom PMPro plugin -> http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
//we have to put everything in a function called on init, so we are sure Register Helper is loaded | |
function my_pmprorh_init() | |
{ | |
//don't break if Register Helper is not loaded | |
if(!function_exists("pmprorh_add_registration_field")) | |
{ | |
return false; | |
} |
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 the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmprorh_init() { | |
//don't break if Register Helper is not loaded | |
if(!function_exists( 'pmprorh_add_registration_field' )) { | |
return false; | |
} |
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 limit_text_area() | |
{ | |
echo | |
" | |
<script> | |
jQuery(document).ready(function() { | |
jQuery('#company_info').on('keyup', function() { | |
var words = this.value.match(/\S+/g).length; |
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_pmprorh_init_2() | |
{ | |
//don't break if Register Helper is not loaded | |
if(!function_exists("pmprorh_add_registration_field")) | |
{ | |
return false; | |
} | |
global $pmpro_countries; |
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_pmprorh_init_2() | |
{ | |
//don't break if Register Helper is not loaded | |
if(!function_exists("pmprorh_add_registration_field")) | |
{ | |
return false; | |
} |
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 this code to your PMPro Customizations Plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* This function below sends a custom HTML email to the user that checks out for a pmpro membership level, easily extendible to send to admins, or specific users and so on. | |
* Website: https://paidmembershipspro.com | |
*/ | |
//this gist will send a custom email when a new member is added using the add member add on |
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 | |
/* Generate checkout email when using Add Member from Admin Add On for Paid Memberships Pro | |
*/ | |
function pmpro_send_member_notification( $user_id ) { | |
$pmproemail = new PMProEmail(); | |
$pmproemail->sendCheckoutEmail( get_userdata( $user_id ) ); | |
} | |
add_action( 'pmpro_add_member_added', 'pmpro_send_member_notification', 10, 2 ); |
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 | |
/* | |
Disable Registration based on Register Helper field value | |
Add this code to your active theme's functions.php or | |
a custom plugin. | |
*/ | |
function my_pmpro_registration_checks($okay) | |
{ | |
//only check if things are okay so far | |
if($okay) |
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_pmpro_confirmation_url($rurl, $user_id, $pmpro_level) | |
{ | |
$rurl = 'http://google.com'; //change this URL | |
return $rurl; | |
} | |
add_filter('pmpro_confirmation_url', 'my_pmpro_confirmation_url', 10, 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 | |
//add lines 4-15 to your custom plugin or functions.php of your active theme | |
function pmpro_remove_bfields( $pmpro_required_billing_fields ){ | |
//remove field ID's from array to make fields required | |
$remove_field = array('bphone'); | |
//loop through the $remove_field array and unset each billing field to make it optional. | |
foreach($remove_field as $field){ |