wp-login action=register -- need register the default state (2 posts)

  1. watermelonkid
    Posted 5 years ago #

    Hello--so I have been playing with this for an hour and can't figure it out. Basically, I have a "members only" WordPress site that requires logging in, or registering (and then logging in) to see the home page.

    In wp-login.php, there is a block of code you can change to set the default action:

    // Main
    $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login';
    $errors = new WP_Error();

    Changing login to register achieves what I want--when the login page comes up, it automatically pulls up the register form instead of the login form. However, when you then navigate to login (say you were a user who clicked the Login link), it seems that WordPress now requires the register form to be filled out in order to log in. I assume this is because of changing the above action to login, but there has to be a way to have the register form come up first, but to still have the login form work.

    Anyone run into this?

  2. watermelonkid
    Posted 5 years ago #

    Nevermind--it's an easy fix. I just needed to change the form action to include the ?action=login since wp-login.php as a default is set to register.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.