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 http://yoursite.com/wp-admin/admin.php?&pmpro_reset_analytics=1 to your url while logged in. | |
| * Add this code to your Code Snippets / Custom Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| * You may remove this code from your site when you don't need it any longer. | |
| */ | |
| function my_pmpro_reset_visit_data() { | |
| // Check if URL parameter pmpro_reset_analytics is set | |
| if ( isset( $_REQUEST['pmpro_reset_analytics'] ) ) { |
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 // be mindful about not duplicating this tag in your customizations plugin. | |
| /** | |
| * This will show the renewal date link within the number of days or less than | |
| * the members expiration that you set in the code gist below. line 18 | |
| * | |
| * 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 | |
| /* | |
| This should allow you to set a calendar end date to work with Gift Memberships. | |
| Use at your own risk. | |
| If a gift level is purchased, copy the set expiration date if applicable. | |
| Must have Gift Membership Add On and with Set Expiration Date being used. | |
| */ | |
| function pmpro_after_checkout_gift_level_set_expiration($user_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 | |
| /** | |
| * This will only show renewal date within 30 days or less than the members expiration. | |
| * Add this code from line 7+ to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| * Visit www.paidmembershipspro.com for help. | |
| */ | |
| function show_renewal_link_on_30_days( $r, $level ) { | |
| if ( empty( $level->enddate ) ) { | |
| return 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 | |
| /** | |
| * This function will stop any user's that aren't validated from logging into your WordPress website. | |
| * This requires PMPro Email Confirmation - https://www.paidmembershipspro.com/add-ons/email-confirmation-add-on/ | |
| * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| * Visit https://paidmembershipspro.com for further assistance. | |
| */ | |
| function my_pmpro_check_login( $user, $password ) { |
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 code recipe references the custom fields you use on your member profiles | |
| * to ensure that they are geocoded and not the default billing fields. | |
| * | |
| * 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 | |
| /** | |
| * This recipe will geocode the custom billing fields we've created during checkout. | |
| * | |
| * 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 | |
| /** | |
| * This will add strike through pricing if the membership pricing is available for currrent user viewing Woo store. | |
| * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| /** | |
| * This will add strike through pricing if the membership pricing is available for currrent user viewing Woo store. | |
| * Add this code to your PMPro Customizations Plugin - 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 this line. | |
| /** | |
| * 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/ | |
| */ | |
| /* | |
| Only show levels on level page which the original content belonged to. For example if a site has 3 levels: Bronze, Silver, Gold and |
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 | |
| /* | |
| * The Code Recipe will add a 15-day grace period to a members membership once the membership expires. | |
| * for specific levels, change line 13 to your level ID | |
| * Add this Code Recipe to a PMPro Customization Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| * For more information on Paid Memberships Pro - www.paidmembershipspro.com | |
| */ | |
| function my_pmpro_membership_post_membership_expiry( $user_id, $level_id ) { | |
| // Make sure we aren't already in a grace period for this level |