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 | |
/** | |
* Redirect to URL depending on which level a user is validating for. | |
* Checks to see if a user currently has a level which will return true if logged in, if user is not logged in redirect them to login. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmproec_after_validate_user() { | |
if( pmpro_hasMembershipLevel( 1 ) ) { | |
wp_redirect("/level-1-url/"); |
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
#other_discount_code_p{font-weight: bold;} |
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 | |
/** | |
* Apply 13% if a user selects 'Canada'. | |
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
// Set 13% tax value. | |
function customtax_pmpro_tax($tax, $values, $order) { | |
$tax = round( (float)$values[price] * 0.13, 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 | |
/** | |
* The following code restricts the following fields to only accept numbers for input - Phone, Credit Card and CVV. | |
* Add the function below to your PMPro Customizations Plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* For assistance visit https://www.paidmembershipspro.com | |
*/ | |
function pmpro_numbers_only_checkout() { | |
?> | |
<script> |
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 function below to your PMPro Customizations Plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
function get_membership_on_login( $user_login, $user ) { | |
$level = pmpro_getMembershipLevelForUser( $user->ID ); | |
// if it's not empty assume user has a level. | |
if( !empty( $level ) ){ |
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 Customizations | |
Plugin URI: https://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Customizations for my Paid Memberships Pro Setup | |
Version: .1 | |
Author: Paid Memberships Pro | |
Author URI: https://www.paidmembershipspro.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 | |
/** | |
* This is an example how to add custom HTML instructions for Pay By Check add-on for Paid Memberships Pro | |
* Copy the following code into your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Visit www.paidmembershipspro.com | |
*/ | |
function add_custom_checkout_instructions_to_pmpro_check() { | |
global $gateway, $pmpro_level; |
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 snippet allows admins without any PMPro membership level to access any restricted content. | |
* Add this code to your PMPro Customizations plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmmpro_allow_access_for_admins($hasaccess, $mypost, $myuser, $post_membership_levels){ | |
//If user is an admin allow access. | |
if( current_user_can( 'manage_options' ) ){ |
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 | |
/** | |
* Redirect user's to a new URL instead of the 'levels' page in PMPro. | |
* Add this code to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function redirect_users_to_a_new_page( $url ){ | |
return 'https://some-url.com'; //change this to the URL you would like to redirect your user's to. |
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 function changes all instances of 'Postal Code' to 'Zip Code' for Paid Memberships Pro. | |
* Add this code to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Visit www.paidmembershipspro.com | |
*/ | |
function pmpro_change_postal_code_text( $translated_text, $text, $domain ){ |