Codex tools: Log in / create account
auth_redirect()
is a simple function that requires that the user be logged in before they can access a page.
<?php auth_redirect() ?>
When this code is called from a page, it checks to see if the user viewing the page is logged in. If the user is not logged in, they are redirected to the login page. The user is redirected in such a way that, upon logging in, they will be sent directly to the page they were originally trying to access.
This function accepts no parameters.