Code, script, functions to log out a user?
-
If I had a log out button that takes the user to a page that runs a script to log him out and then redirects him somewhere, how would the script in that page look like? Does it need a nonce?
ie:
<?php /* Template Name: Sign Out */ wp_clear_auth_cookie(); echo "Signing you out, please wait..."; echo "<script type='text/javascript'>window.location = '".get_permalink(16)."?action=logout';</script>"; exit; ?>
The topic ‘Code, script, functions to log out a user?’ is closed to new replies.