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 | |
// Copy from below here... | |
/* | |
* Sets the gateway 'ready' global to true | |
*/ | |
function my_pmpro_payfast_fix_warning( $pmpro_is_ready ) { | |
return 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 | |
/** | |
* This recipe will add tax based on the different Canadian regions. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_custom_canada_tax( $tax, $values, $order ) { |
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 recipe will only add the billing fields to the user profile edit page. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ |
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 hide_discount_code_field_for_specific_levels($show) | |
{ | |
global $pmpro_level; | |
if( in_array( intval( $pmpro_level->id ), array(1,2) ) ) | |
{ | |
$show = 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 //do not copy | |
//declare as globals | |
global $pmproio_invite_required_levels; | |
global $pmproio_invite_given_levels; | |
$pmproio_invite_required_levels = array(4); //Which levels require an invite code (these levels cannot be signed up for without an invite code) | |
$pmproio_invite_given_levels = array(5); //Which levels generate an invite code but do NOT require an invite code to be used when purchasing. | |
define('PMPROIO_CODES', 10 ); //How many invite codes are generated when a $pmproio_invite_given_levels level is purchased? |
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 | |
/** | |
* Show a list of users that recently signed up. Currently only shows user names and the last 5 registrations. | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* Use [pmpro_latest_members] shortcode to display a list of users. | |
*/ | |
function pmpro_show_latest_members_name_shortcode( $atts ) { | |
global $wpdb, $pmpro_pages; |
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 //Do not copy | |
/* | |
Redirect to login or homepage if user is logged out or not a member | |
Add this code to your active theme's functions.php file. | |
*/ | |
function my_template_redirect() | |
{ | |
global $current_user; | |
if( !function_exists( 'pmpro_login_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
<?php | |
/* | |
Plugin Name: PMPro Customizations | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Customizations for PMPro | |
Version: .1 | |
Author: Stranger Studios | |
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 | |
/** | |
* Plugin Name: My PMPro Directory Widget | |
* Description: Add widget to Member Directory page to filter results. | |
*/ | |
class My_PMPro_Directory_Widget extends WP_Widget { | |
/** | |
* Sets up the widget | |
*/ |
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
/* | |
1. Make sure PMPro and PMPro Proration are both active. | |
2. Edit the pmpro_checkout_level_custom_prorating_rules function below to your needs. | |
3. Then add this code into a custom plugin for your site. | |
*/ | |
/** | |
* Swap in our custom prorating function. | |
*/ | |
function init_custom_prorating_rules() { |