Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom usage of wp_signon does not track user logins correctly #434

Closed
shadyvb opened this issue Apr 23, 2014 · 0 comments

Comments

Projects
None yet
2 participants
@shadyvb
Copy link
Contributor

commented Apr 23, 2014

As reported in support forums

I'm using the "password protected" plugin that will force users to login using a custom form and a custom password. I use this plugin to prevent access to the whole site from unwanted users.
Once done, if the first custom password management login is successfull, the code will signon on users accordingly:

/* begin my code */
        $creds = array();
        $creds['user_login'] = 'username';
        $creds['user_password'] = 'thepassword';
    $creds['remember'] = true;
    $user = wp_signon( $creds, false );
    if ( is_wp_error($user) )
        echo $user->get_error_message();
       // run it before the headers and cookies are sent
       add_action( 'after_setup_theme', 'custom_login' );
/* end my code */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.