添加此筛选器以更改空白用户名/密码的处理方式:
add_filter( \'authenticate\', \'custom_authenticate_username_password\', 30, 3);
function custom_authenticate_username_password( $user, $username, $password )
{
if ( is_a($user, \'WP_User\') ) { return $user; }
if ( empty($username) || empty($password) )
{
$error = new WP_Error();
$user = new WP_Error(\'authentication_failed\', __(\'<strong>ERROR</strong>: Invalid username or incorrect password.\'));
return $error;
}
}
然后,您在wp\\u login\\u失败时的原始重定向也将使用空用户名/密码。