• Hi,

    I have a site where I am implementing a custom login page. It’s just a WordPress page with a login form on it.

    Can I use your plugin if I’m not using the default WP Login screen?

    If so, are there any functions or actions I can call/hook into within the code to capture things like remaining attempts? Or a lockout message? To display to the user? Is there any documentation on this plugin?

Viewing 1 replies (of 1 total)
  • Hello,
    I am also interested in this question.

    In the basic form it seems that you can use wp_authenticate() to check if user credentials are valid. The majority of plugins hooks will automatically work while this check. There is global instance of $limit_login_attempts_obj which has get_message() method to get error messages. This method also can be used for displaying error info on the form by default if user is already blocked or has ‘spent’ some auth attempts.
    When plugin is active and user is blocked, wp_authenticate() will return WP_Error even for correct credentials. So code can look something like this:

    $authResult = wp_authenticate($login, $password);
    
    if (is_wp_error($authResult)) { 
        ...
        $errMsg = 'Custom error message.';
        ...
    
        global $limit_login_attempts_obj;
        if ($limit_login_attempts_obj) $errMsg .= '<br>' . $limit_login_attempts_obj->get_message();    
        ...

    Will be great to have any comments from plugin developers! Thank you for great work!

    • This reply was modified 6 years, 4 months ago by Vishnja1.
    • This reply was modified 6 years, 4 months ago by Vishnja1.
Viewing 1 replies (of 1 total)
  • The topic ‘Custom Login Page’ is closed to new replies.