Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ipokkel/07ea49b869aeaa51353ed4029090ea71 to your computer and use it in GitHub Desktop.
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.
<?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