This file contains hidden or 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 | |
/** | |
* Swap the word Membership with Access in the PMPro expiration text. | |
* Add this through a code snippet or custom plugin. | |
*/ | |
function my_custom_level_expiration_text( $expiration_text, $level ) { | |
$expiration_text = str_replace( 'Membership', 'Access', $expiration_text ); | |
return $expiration_text; | |
} |
This file contains hidden or 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
/** | |
* Tell PMPro allow weak passwords on the change password and reset password forms. | |
* Requires PMPro v2.3.3+ | |
*/ | |
add_filter( 'pmpro_allow_weak_passwords', '__return_true' ); |
This file contains hidden or 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
/** | |
* Forward PMPro IPNs to another PMPro site. | |
*/ | |
function my_pmpro_forward_ipn() { | |
$fp = wp_remote_post( 'https://theothersite.com/wp-admin/admin-ajax.php?action=ipnhandler', $_POST ); | |
} | |
add_action('wp_ajax_nopriv_ipnhandler', 'my_pmpro_forward_ipn', 5); | |
add_action('wp_ajax_ipnhandler', 'my_pmpro_forward_ipn', 5); |
This file contains hidden or 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 a filter to the PMPro orders table | |
* in the WordPress dashboard | |
* to show the past 30 days of orders. | |
* Requires PMPro 2.3 or higher. | |
* Add this code through a Code Snippet or Custom Plugin. | |
*/ | |
// Add the filter. | |
function my_pmpro_admin_orders_filters_past30( $filters ) { |
This file contains hidden or 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 international addresses (include country, longer state field). | |
add_filter( 'pmpro_international_addresses', '__return_true' ); | |
?> |
This file contains hidden or 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
/** | |
* This gist will disable the default behavior in PMPro BuddyPress 5.2.5 or earlier, | |
* which would redirect users away from the BP profile pages if you had | |
* "all of BuddyPress" locked down for non-members or members of a specific level. | |
* | |
* We might address this in future versions of the Add-On, but for now, you can use | |
* this gist. Add it to a Code Snippet or a custom plugin. | |
*/ | |
// First disable the default PMPro BuddyPress behavior. |
This file contains hidden or 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
/** | |
* Discounts when purchasing multiple levels with PMPro MMPU | |
* | |
* 1. Add this to a custom plugin or code snippet. | |
* 2. Adjust the discount_levels array. | |
* 3. Adjust the logic for when the price is changed and how much. | |
* 4. Make sure to remove the billing_amount lines if you don't have recurring billing. | |
*/ | |
function my_pmpro_checkout_level_discounts( $level ) { | |
$discount_levels = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ); |
This file contains hidden or 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
/** | |
* Synchronize Stripe invoice.payment_succeeded Events | |
* Warning. This code will update your database, | |
* create new orders, and potentially email your customers. | |
* Proceed with caution. Back up your database. | |
* You will likely want to pair this script with a plugin | |
* or script to disable all email. | |
* The default limit is 200 events. You may need to increase this | |
* or update the script to paginate and run events in batches. | |
* The default delay between event calls is 2 seconds. |
This file contains hidden or 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: .2 | |
Author: Stranger Studios | |
Author URI: http://www.strangerstudios.com | |
*/ | |
/* |
This file contains hidden or 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
// Unhook JNews Theme Ads if the user is a PMPro member | |
// Add this code into a custom plugin. | |
// I am not sure that this is running late enough to override | |
// the JNews Ad insert. You may need to hook into init later | |
// or even another hook that runs later. | |
function my_hide_jnews_ads_from_members() { | |
// do nothing if PMPro is not running | |
if ( ! function_exists( 'pmpro_hasMembershipLevel' ) ) { | |
return; | |
} |