Created
February 19, 2018 03:44
-
-
Save daniloparrajr/f23b003514354ddfdc973c5704dd4299 to your computer and use it in GitHub Desktop.
Wordpress Redirect user
This file contains hidden or 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 | |
function themeprefix_redirect_user() | |
{ | |
if( is_page( 'login' ) && ! is_user_logged_in() ) | |
{ | |
wp_redirect( home_url( '/signup/' ) ); | |
die; | |
} | |
} | |
add_action( 'template_redirect', 'themeprefix_redirect_user' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment