Thank you Dave for your helpful reply.
Here is the final and functioning code for others, if they need one:
One question, with the above code, the user is logged out then redirected to the forum home. My forum is installed in mydomain.com/forum. How can I redirect users after logout to mydomain.com?
--------------- Added 03 Sep 2019 at 16:58 ---------------
Maybe I should ask the question differently.
Is it possible to execute the as a function or in the background, instead of redirecting to it as a URL?
No members have liked this post.