Limit Login Attempts
Empty login error div shown at all times (2 posts)

  1. marcfalk
    Posted 4 years ago #

    Whenever I activate the plugin, the login error box is shown at all times - not only when an error occurs. There is no text in the box, unless I manipulate the login error message like this:

    	function login_error_message($error){
    	    //check if that's the error you are looking for
    	    $pos = strpos($error, 'incorrect');
    	    if ($pos === false) {
    	        //its the right error so you can overwrite it
    	        $error = "Det indtastede brugernavn eller kodeord var forkert, prov igen.";
    	    return $error;

    Any ideas on what could be the problem?


  2. johanee
    Plugin Author

    Posted 4 years ago #

    My guess would be that you have some other filter that clears the error message. There has to be some error, or the box divs wouldn't be shown.

    To get the original error message and find which filters are registered you could try something like this:

      Plugin Name: Debug Login Errors
      Description: Debug the login_errors filter
      Author: Johan Eenfeldt
      Version: 0.1
    // use the 'all' filter to make sure we get called first
    function debug_login_errors($filter) {
    	if ($filter != 'login_errors')
    	$args = func_get_args();
    	if (count($args) < 2)
    	$error = $args[1];
    	// Original error
    	echo '<p>Original error:<br />';
    	echo '</p>';
    	// Filters
    	global $wp_filter;
    	echo '<p>Filters:<br />';
    	echo '</p>';

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Limit Login Attempts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic