I am writing a plugin that involves deleting user accounts. These users may or may not be logged in when their account is deleted. If they are logged in when this happens, the next time they attempt to access the site they are redirected and an error message displays at the top of the screen about accessing a null value. I know how to resolve the error message, as that function is overridable, but I would like to see if an alternative approach is available.
Is it possible to forcefully redirect a logged in user to a specific webpage? I have the userid if the account(s) that get deleted, so would it be possible to use a modification of qa_redirect() to force their browsers to update and take them to another web page? This would absolve the issue, and allow me to redirect them to a custom page explaining why their account has been removed.