danyaneh
2/19/2018 - 3:44 AM

Wordpress Redirect user

Wordpress Redirect user

<?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' );