Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save strangerstudios/af45ff954013cbf20ec030c33a958ef2 to your computer and use it in GitHub Desktop.
Save strangerstudios/af45ff954013cbf20ec030c33a958ef2 to your computer and use it in GitHub Desktop.
Force the Paid Memberships Pro expiration script to run immediately.
/*
Force the PMPro expiration script to run immediately.
Add this code into a custom plugin, then login as an admin and visit /?expirenow=1
*/
function pmpro_cron_expire_memberships_now() {
if(!empty($_REQUEST['expirenow']) && current_user_can('manage_options')) {
echo "Forcing expirations now<hr />";
pmpro_cron_expire_memberships();
exit;
}
}
add_action('init', 'pmpro_cron_expire_memberships_now');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment