Codex

Function Reference/auth redirect

Description

auth_redirect() is a simple function that requires that the user be logged in before they can access a page.

Default Usage

<?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.


Parameters

This function accepts no parameters.

Related

is_user_logged_in(), wp_redirect()