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 dparker1005/02a562f77697979c163e2e8bfac3f597 to your computer and use it in GitHub Desktop.
Save dparker1005/02a562f77697979c163e2e8bfac3f597 to your computer and use it in GitHub Desktop.
Fetch next payment dates from payment gateways during the expiration warnings cron. This also affects emails sent by the PMPro Recurring Emails Add On.
<?php
/**
* Fetch next payment dates from payment gateways during the expiration warnings cron. This
* also affects emails sent by the PMPro Recurring Emails Add On.
*/
function my_pmpro_cron_expiration_warnings_filter_next_payments() {
add_filter('pmpro_next_payment', array('PMProGateway_paypalexpress', 'pmpro_next_payment'), 10, 3);
add_filter('pmpro_next_payment', array('PMProGateway_braintree', 'pmpro_next_payment'), 10, 3);
}
add_action( 'pmpro_cron_expiration_warnings', 'my_pmpro_cron_expiration_warnings_filter_next_payments', 5 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment