Created
May 12, 2016 15:26
-
-
Save strangerstudios/af45ff954013cbf20ec030c33a958ef2 to your computer and use it in GitHub Desktop.
Force the Paid Memberships Pro expiration script to run immediately.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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