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 PHP tag. | |
| /** | |
| * Send recurring subscription payment email reminder 14 days before subscription payment. | |
| * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmpro_change_recurring_emails( $emails ) { | |
| // Remove the email that is sent 7 days before subscription payment. | |
| unset( $emails[7] ); | |
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 include in Customizations plugin if copying and pasting | |
| /** | |
| * This code gist illustrates a way to customize the format of how your currency displays. | |
| * | |
| * In this example, we will change the PMPro Danish Krone currency | |
| * | |
| * from DKK 1,495.00 | |
| * to DKK 1 495,00 | |
| * | |
| * Adjust this code gist to suit your needs for currency. |
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 code recipe will remove the billing address fields from certain membership levels. | |
| * This code gist requires the Paid Memberships Pro - Capture Name & Address for Free Levels or for Off-site Gateways Add On to be installed and activated - https://www.paidmembershipspro.com/add-ons/capture-name-address-free-levels-offsite-gateway/ | |
| * Change the value "4" in the code recipe with the Paid Memberships Pro Membership Level ID of your choice. | |
| * Add this code below into your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function remove_pmpro_billing_fields_by_level_id() { | |
| // Specify the Membership Level ID |
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 the Paid Memberships Pro invoice email on initial checkout for members. | |
| * Add this code below into your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function pmpro_after_checkout_send_invoice_email( $user_id, $order ) { | |
| $email = new PMProEmail(); | |
| $email->sendInvoiceEmail( $user_id, $order ); | |
| } |
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 | |
| /** | |
| * Use the pmprowoo_get_membership_price filter to set prices for variable products. | |
| * Update the $membership_prices array. | |
| * Each item in that array should have a key equal to the membership level id, | |
| * and a value equal to an array of the form array( {variable_product_id} => {member_price} ) | |
| * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmprowoo_get_membership_price( $discount_price, $level_id, $original_price, $product ) { | |
| // Setup your arrays of product ids to membership prices. |
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 | |
| /** | |
| * Load custom CSS on checkoutpage for specific membership level in Paid Memberships Pro. | |
| * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function load_css_for_level_checkout(){ | |
| global $pmpro_pages; | |
| // Change your membership level ID here. |
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 this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| * The my_pmpro_renew_membership_shortcode is a custom function creating a renew link for members. | |
| * Use the shortcode [pmpro_renew_button] to display the button anywhere on your site where shortcodes are recognized. | |
| * | |
| * @return string A link containing the URL string to renew. | |
| */ | |
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 | |
| /** | |
| * Display messages of the Original Price, Discounted Price and Amount Saved when discount code is applied to PMPro order. | |
| * Add this code recipe to a PMPro Customization Plugin - Display messages of the Original Price, Discounted Price and Amount Saved when discount code is applied to PMPro order | |
| * Various classes added to strings to allow for styling - ".pmpro-discorig-message", ".pmpro-orginal-price", ".pmpro-discount-price", ".pmpro-save-price" | |
| * | |
| * [my_pmpro_applydiscountcode_return_js] Display original price and discount when a discount code is applied. | |
| * @param string $discount_code [description] | |
| * @param integer $discount_code_id [description] |
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 this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| * Change the default Country for Paid Memberships Pro - https://www.paidmembershipspro.com | |
| * Find Country Codes here - https://github.com/strangerstudios/paid-memberships-pro/blob/dev/includes/countries.php | |
| */ | |
| function filter_pmpro_default_country( $default_country ) { | |
| // Set country code to "GB" for United Kingdom. |
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 //careful not to duplicate this tag in your customizations.functions.php file | |
| /* | |
| * Change the word "Howdy" to "Hello" in your WordPress Admin Bar. | |
| * Add to a Customization Plugin of your choice. | |
| * If a PMPro Member, you can add code to a Paid Memberships Pro Customizations Plugin. | |
| */ | |
| function wp_admin_bar_my_custom_account_menu( $wp_admin_bar ) { | |
| $user_id = get_current_user_id(); | |
| $current_user = wp_get_current_user(); |