You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have came across a solution which works fine and below is the sample code.
add_action('delete_user','pmpro_mailchimp_handle_delete');
function pmpro_mailchimp_handle_delete( $user_id ){
pmpromc_unsubscribeFromLists($user_id);
}
I also tried adding the user to the unsubscribe queue we had in the plugin itself but there was issue like we are executing pmpromc_unsubscribeFromLists this method with three hooks and all of them seems to be not working due to execution order. Like wp_redirect executes and before delete_user itself, user gets deleted from the wordpress and hence when we call pmpromc_unsubscribeFromLists in mean while our user gets deleted and we have nothing in hand to delete the user and we fail in deleting the user.
add_action('delete_user','pmpro_mailchimp_handle_delete');
function pmpro_mailchimp_handle_delete( $user_id ){
pmpromc_queueUserToUnsubscribeFromLists($user_id);
}
I believe that when a user is deleted, their membership is removed. But there could still be opt-in lists that they need to be removed from.
The text was updated successfully, but these errors were encountered: