| // If user not logged in, redirect to login page | |
| if ( | |
| !in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php')) | |
| && !is_admin() | |
| && !is_user_logged_in() | |
| ) { | |
| header('Vary: Cookie'); | |
| header("Cache-Control: no-cache, max-age=0, must-revalidate"); | |
| wp_redirect('http://your-url.com/wp-admin', 302); | |
| exit; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment