• thebigtine

    (@josephbydesign)


    I am using custom redirects (shown below) to take users to new login and register pages

    add_action('init','yobd_reg_redirect');
    
    function yobd_reg_redirect(){
      global $pagenow;
      if( 'wp-login.php' == $pagenow ) {
        if ( isset($_GET['action']) && $_GET['action']=='register') { ?>
            <script>
    
                window.location.assign("<?php home_url() ?>/create-an-account/");
    
            </script>
            <?php }
        else wp_redirect(home_url('/user-login'));
        exit();
      }
    }

    this all works except the login form which has a form action to wp-login.php (action="domain.com/wp-login.php"), but because it is redirecting from wp-login.php it won’t let the user login at all. I know this is really a messy way to do it, but my client’s theme already has other login/register pages which he doesn’t want to use as he wants email confirmation

  • The topic ‘Custom Redirects Preventing login’ is closed to new replies.