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 //do not copy | |
| //Remove the current text we add to PMPro no access message | |
| function mypmpro_remove_original_ec_text(){ | |
| remove_filter( 'pmpro_no_access_message_body', 'pmproec_pmpro_text_filter' ); // PMPro 3.1+ | |
| remove_filter( 'pmpro_non_member_text_filter', 'pmproec_pmpro_text_filter' ); // Pre-PMPro 3.1 | |
| remove_filter( 'pmpro_not_logged_in_text_filter', 'pmproec_pmpro_text_filter' ); // Pre-PMPro 3.1 | |
| } | |
| add_action( 'init' ,'mypmpro_remove_original_ec_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
| <?php //do not copy | |
| function my_pmpro_email_headers_email_confirmation( $headers, $email ) { | |
| if( ! function_exists( 'pmproec_isEmailConfirmationLevel' ) ) { | |
| return $headers; | |
| } | |
| // BCC email confirmation emails to another email address | |
| if ( |
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 | |
| /** | |
| * Stop non-members from purchasing products if they do not have an active Paid Memberships Pro Level. | |
| * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function stop_pmpro_members_from_buying_woo( $is_purchasable, $product ) { | |
| // Check if the user has an active membership level. |
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 //do not copy | |
| /** | |
| * 1. Block checkout immediately if user already has the same level. | |
| */ | |
| function my_pmpro_prevent_same_level_on_load() { | |
| global $pmpro_pages; | |
| // Only run on checkout page and for logged-in users | |
| if ( ! is_page( $pmpro_pages['checkout'] ) || ! is_user_logged_in() ) { | |
| return; |
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 //do not copy | |
| /** | |
| * This recipe forces every checkout to require approval. | |
| * | |
| * Requires the Approvals Add On to be active for this to work. | |
| * | |
| * 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 | |
| // Make all fields editable on the orders page in the PMPro dashboard | |
| add_filter( 'pmpro_orders_read_only_fields', function( $fields ) { | |
| return array(); | |
| } ); | |
| /** | |
| * Register the Stripe Customer ID field for admin profiles | |
| */ | |
| function my_pmpro_add_stripe_customerid_field() { |
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 //do not copy | |
| /** | |
| * This recipe ensures that the member can only hold one level across all groups. | |
| * Signing up for more than one group across any level groups will cancel all other levels. | |
| * | |
| * 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 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 //do not copy | |
| /** | |
| * Adds the number of seats to the bottom of the confirmation page near the totals | |
| * | |
| * 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 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 | |
| /** | |
| * Override the Geocoding API key to a private key. This helps if you want to restrict | |
| * usage of the Geocoding API key. This key is not public like the JS Map API Key. | |
| * | |
| * To be used with Member Directory 2.1+ | |
| * | |
| * 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. |
NewerOlder