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 | |
| /* | |
| * This codes requires you to have the PMPro Sponsored/Group Members Add On - https://www.paidmembershipspro.com/add-ons/pmpro-sponsored-members/ | |
| * Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| * This code recipe is an example that allows membership level 2 to purchase 5 group membership accounts for membership level 3. | |
| * However, level 3 members will need to individualy pay an initial payment of $20 for their membership accounts. | |
| */ | |
| global $pmprosm_sponsored_account_levels; |
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 | |
| /** | |
| * This will show a member number on the membership card for Paid Memberships Pro. Please read all comments below! | |
| * This requires the following - https://www.paidmembershipspro.com/generate-a-unique-member-number-for-display-on-membership-account-confirmation-email-and-more/ | |
| * At the time of this writing, created a custom page template and added in hook "do_action( 'pmpro_membership_card_additional_fields', $pmpro_membership_card_user );" to the relevant area. | |
| * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| * Reach out to the PMPro Support team for help with this code recipe - https://www.paidmembershipspro.com/support/ | |
| */ | |
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 | |
| /** | |
| * Show member number in Members List and Members List CSV export. | |
| * Useful for offering multiple pricing structures for membership (i.e. Monthly, Annually). | |
| * Requires the PMPro Member Unique Number Code Recipe - https://www.paidmembershipspro.com/generate-a-unique-member-number-for-display-on-membership-account-confirmation-email-and-more/ | |
| * Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmpro_members_list_csv_extra_columns($columns) |
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 | |
| /** | |
| * Tweaked from BCC Admin on Member Emails - https://www.paidmembershipspro.com/bcc-additional-email-addresses-on-member-or-admin-notifications/ | |
| * Add this code to your PMPro Customizations Plugin. | |
| * Adjust the membership ID to match that of your levels. | |
| */ | |
| function my_pmpro_email_headers( $headers, $email ) { | |
| // Default BCC address to default email address. |
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 | |
| /** | |
| * Create payment plans by mapping a level to discount codes representing payment plan options. | |
| * Useful for offering multiple pricing structures for membership (i.e. Monthly, Annually) | |
| * | |
| * Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| global $pmpro_payment_plans; |
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 | |
| /** | |
| * This shows the WordPress User ID as a Member ID on the Paid Memberships Pro Account Page. | |
| * Add the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| * www.paidmembershipspro.com | |
| */ | |
| function pmpro_add_user_id_account() { | |
| global $current_user; |
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 | |
| /** | |
| * Send WP new user email and PMPro admin change email after registering a member through a PMPro Zapier zap | |
| * Requires Paid Memberships Pro and PMPro Zapier add on to be installed and activated - https://www.paidmembershipspro.com/add-ons/pmpro-zapier/ | |
| * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmpro_zapier_email_after_change_level( $level_id, $user_id ){ | |
| if( isset( $_SERVER["REQUEST_URI"] ) && ( strpos( $_SERVER["REQUEST_URI"], "pmpro_zapier_webhook" ) !== false ) ){ |
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 | |
| /** | |
| * Show next payment date under 'Expiration' field in PMPro account page. | |
| * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| * Works for PayPal Express and Stripe payment gateways. | |
| * www.paidmembershipspro.com | |
| */ | |
| // Change the expiration text to show the next payment date instead of the expiration date | |
| // This hook is setup in the wp_renewal_dates_setup function below | |
| function my_pmpro_expiration_text($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
| <?php | |
| /** | |
| * Adds a custom phone field to PMPro checkout page. | |
| * Requires the PMPro Register Helper Add On to be installed and activated - https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/ | |
| * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmprorh_init() | |
| { | |
| //don't break if Register Helper is not loaded |
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 | |
| /** | |
| * This will exclude products that belong to a specific category from the membership discount. | |
| * Add the below code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmpro_exclude_woocommerce_discounts_for_categories( $price, $level_id, $original_price, $product ) { | |
| // Array of categories to exclude, uses category slug. | |
| $exclude_categories = array( 'category-1', 'category-2', 'category-3' ); |