Created
December 1, 2016 05:38
-
-
Save lunaroja/1a0475e51e962dc98744873d6beafa4e to your computer and use it in GitHub Desktop.
wp_redirect_not_loggedin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$redirect_url = 'https://google.com/'; | |
if ($redirect_url && !in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php')) | |
&& !is_admin() && !is_user_logged_in()) { | |
wp_redirect( $redirect_url , 302 ); exit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment