schedult card expiration

This commit is contained in:
asus
2024-04-09 22:33:34 +02:00
parent 364553612a
commit a2e37cf621
4 changed files with 53 additions and 42 deletions

View File

@@ -85,4 +85,36 @@ function handle_card_expire_CIPF($user_id) {
/*
* this function will delete the account if the deletion date is expired
* it is called both by e scheduled event, and every time a prof go on its page
*
*/
function handle_prof_account_deletion_CIPF($user_id) {
Plgntls::debug_infos();
/*
* check if account still exists
*
*/
if (false === get_user_by('id', $user_id)) {
return;
}
/*
* check if account should be deleted
*
*/
if (!is_prof_account_deletion_date_exceeded_CIPF($user_id)) {
return;
}
send_emails_CIPF('account_deleted', $user_id);
include_once(ABSPATH.'wp-admin/includes/user.php');
wp_delete_user($user_id);
}
?>