login_errors
login_errors is a filter that filters any error messages in wp-login.php
Context:
File: wp-login.phpif ( !empty( $errors ) ) {
if ( is_array( $errors ) ) {
$newerrors = "\\n";
foreach ( $errors as $error ) $newerrors .= ' ' . $error . "\\n";
$errors = $newerrors;
}
echo '<div id="login_error">' . apply_filters('login_errors', $errors) . "</div>\\n";
}
This hook is a filter which means that information is passed through it, and then used by WordPress. Your function needs to accept that information, and return it. Using add_filter('login_errors', 'your_function'); helps you to remember this distinction. When you are passing an ID, it is assumed that you will return the ID as it was given to you. With filters that pass strings or arrays, you may manipulate the information before passing it along.
This hook was introduced in WordPress 2.1, and will not work in earlier versions.