Created
April 13, 2021 07:35
-
-
Save ipokkel/07ea49b869aeaa51353ed4029090ea71 to your computer and use it in GitHub Desktop.
Prevent duplicate "Your access will expire on [DATE]" notification in email if both Auto Renewal Checkbox and Cancel on Next Payment Date Add On's are active.
This file contains 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 removes the cancel email filter for Auto Renewal Checkbox | |
* if Cancel on Next Payment Date Add On is active to prevent duplication | |
* of the expiration notice "Your access will expire on [DATE]" in the email. | |
* | |
* 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/ | |
*/ | |
function remove_pmproarc_email_filter_for_cancel_email() { | |
if ( function_exists( 'pmproconpd_pmpro_before_change_membership_level' ) ) { | |
remove_filter( 'pmpro_email_body', 'pmproarc_pmpro_email_body' ); | |
} | |
} | |
add_action( 'init', 'remove_pmproarc_email_filter_for_cancel_email' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment