Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Created November 27, 2015 21:24
Show Gist options
  • Save strangerstudios/a9534e7b5c62ac7950f7 to your computer and use it in GitHub Desktop.
Save strangerstudios/a9534e7b5c62ac7950f7 to your computer and use it in GitHub Desktop.
Disable PMPro Cron Jobs for Expirations, Expiration Warnings, and Expiring Credit Card Warnings
/*
Note the commented out lines below. This is setup now to only disable the expiration warnings email,
but if you uncomment the other lines it will disable those scripts.
Add this code to your active theme's functions.php or a custom plugin.
*/
function init_disable_pmpro_crons()
{
//remove_action("pmpro_cron_expire_memberships", "pmpro_cron_expire_memberships");
remove_action("pmpro_cron_expiration_warnings", "pmpro_cron_expiration_warnings");
//remove_action("pmpro_cron_credit_card_expiring_warnings", "pmpro_cron_credit_card_expiring_warnings");
}
add_action('init', 'init_disable_pmpro_crons');
@Bobz-zg
Copy link

Bobz-zg commented Sep 20, 2017

function init_disable_pmpro_crons() {

	wp_clear_scheduled_hook('pmpro_cron_expire_memberships');
	wp_clear_scheduled_hook('pmpro_cron_expiration_warnings');
	wp_clear_scheduled_hook('pmpro_cron_credit_card_expiring_warnings');
}
add_action('init', 'init_disable_pmpro_crons', 989);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment