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 | |
| /** | |
| * 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. | |
| */ | |
| // Copy from below this line | |
| /** |
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 | |
| // Copy from below here... | |
| /** | |
| * Checks if a certain discount code was used in the checkout and: | |
| * - Shows a special message on the Confirmation page | |
| * - Includes a special message in the Confirmation email | |
| * - Shows a message on the Invoice for that order/checkout | |
| * - Shows a message on the Account page if the most recent order used the code in the past week |
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 | |
| // 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 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 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 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 | |
| // 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 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 | |
| // 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 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 | |
| // 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 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 | |
| // 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 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 | |
| // 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 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 | |
| /* | |
| * 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; |