• Resolved kibus90

    (@kibus90)


    Hello,

    I created my custom front-end login form. And from this time I can not see logs and when somone last time login.

    Do you have some “function” in php which I can put in the last step of my login form which will force save logs login to my website?

    Grettings,
    Dariusz.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Andrew Lima

    (@andrewza)

    Hi @kibus90,

    Thank you for using When Last Login.

    This plugin will only work if you make use of the wp_login hook. If your custom login form isn’t using this but doing it differently you’d definitely need to use custom code.

    Here’s the function that we use to track the login time for the user – https://github.com/andrewlimaza/when-last-login/blob/master/when-last-login.php#L188

    I hope this helps get you started.

    Thread Starter kibus90

    (@kibus90)

    Hello @andrewza
    Thank you for your reply.

    Is possible to change the hook for different?

    My part of code which is responsible for login:

    if(empty($errors)) {
                if(!is_email( $_POST['pippin_user_login'] )){
                    wp_redirect( $_POST['redirect_to'] );
    			wp_setcookie($_POST['user_login'], $_POST['user_pass'], true);
    			wp_set_current_user($user->ID, $_POST['user_login']);
    			die;
                } else {
                     wp_redirect( $_POST['redirect_to'] );
               	wp_setcookie(get_user_by( 'email', $_POST['user_login'] )->user_login, $_POST['user_pass'], true);
    			wp_set_current_user(get_user_by( 'email', $_POST['user_login'] )->ID, $_POST['user_login']);   die;
                }

    I tried to add little bit custom code but does not save logs.

    Could you help me with it? ??

    Thank you in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘The plugin does not work with custom Front-End login form’ is closed to new replies.