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... | |
/** | |
* On login, loop through all user fields and check if any are taxonomy fields. | |
* If so, check the user's meta value for that field. If the taxonomy option label | |
* is stored, change it to the ID. | |
* | |
* Upgrade script to go along with this bug fix PR: https://github.com/strangerstudios/paid-memberships-pro/pull/2423 |
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 Allowlist | |
* Plugin URI: https://www.paidmembershipspro.com | |
* Description: Only allow specific email addresses and usernames to check out using PMPro. Forked from Register Helper. | |
* Version: 1.0 | |
* 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 | |
// Copy from below here... | |
/** | |
* Prevent users from cancelling their membership or checking out for a new one. | |
*/ | |
function my_pmpro_redirect_cancel_to_stripe() { | |
global $pmpro_pages; | |
if ( ! empty( $pmpro_pages['cancel'] ) && is_page( $pmpro_pages['cancel'] ) ) { |
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. | |
/** | |
* Do not update user's first and last name while on the PMPro Checkout page. | |
* Useful if you do not want the user's billing name to be the name on the account. | |
*/ | |
function my_pmpro_prevent_name_save_at_checkout( $check, $object_id, $meta_key ) { | |
if ( $meta_key === 'first_name' || $meta_key === 'last_name' ) { |
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... | |
/** | |
* Hide default member badges. Useful if some of your levels should not show badges. | |
* | |
* 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. |
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... | |
/** | |
* Send admin checkout emails when using the PMPro Multiple Memberships per User Add On. | |
* | |
* 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. |
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 this line. | |
/** | |
* If the cancellation email is being sent because of a cancelled payment subscription, | |
* then send a different email body. | |
*/ | |
function my_pmpro_email_body_cancelled_subscription( $body, $email ) { | |
if ( $email->template == 'cancel' && pmpro_doing_webhook() ) { |
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 | |
/* | |
* Redirects members-only content to the Membership Levels page on the Main Network Site | |
* if a user is logged out or not a member. | |
*/ | |
function my_template_redirect_network_require_membership_access() { | |
if ( function_exists( 'pmpro_has_membership_access' ) && ! pmpro_has_membership_access() ) { | |
wp_redirect( network_site_url( 'levels' ) ); | |
exit; |
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... | |
/* | |
* Round down initial payment price for users switching levels. | |
* Useful to make prorated prices look more friendly. | |
*/ | |
function my_pmpro_checkout_level_round_down_initial_payment( $level ) { | |
// We only want to round down prorations. |
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... | |
/* | |
* Creates a log at /paid-memberships-pro/logs/create_recurring_payments_profile_response.txt for whenever we create | |
* a recurring payment profile in PayPal. | |
* | |
* Useful for debugging a "Missing PROFILESTATUS" error or initial subscription orders in "error" status. | |
*/ |