Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // checks if a user is logged in, if not redirect them to the login page
- function auth_redirect_login() {
- $user = wp_get_current_user();
- if ( $user->id == 0 ) {
- nocache_headers();
- wp_redirect(get_option('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']));
- exit();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement