Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* Hook into pmpro_registered_crons to add PBC crons to site health info #135

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions includes/crons.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,30 @@ function pmpropbc_deactivation() {
}
register_deactivation_hook( PMPRO_PAY_BY_CHECK_BASE_FILE, 'pmpropbc_deactivation' );



/**
* Add PBC crons to the PMPro crons list to pull the site health report.
*
* @param array $schedules The list of registered crons for Paid Memberships Pro.
* @return array The list of registered crons for Paid Memberships Pro.
* @since TBD
*/
function pmpropbc_add_cron_schedule( $schedules ) {
$schedules['pmpropbc_cancel_overdue_orders'] = array(
'interval' => 'daily',
);
$schedules['pmpropbc_recurring_orders'] = array(
'interval' => 'daily',
);
$schedules['pmpropbc_reminder_emails'] = array(
'interval' => 'daily',
);
return $schedules;
}

add_filter( 'pmpro_registered_crons', 'pmpropbc_add_cron_schedule' );

/**
* Create pending orders for subscriptions.
*/
Expand Down