Leave a Reply

1 comment

  1. Check for an empty user login in the $_REQUEST array:

    if ( empty( $_REQUEST['user_login'] ) // && or || empty( $_REQUEST['user_pass'] )
      return $redirect_to_whereever_you_want;
    

    But this filter is to late. It is called after the user is logged in. You have to use the 'wp_authenticate' action, this is one of the earliest action in the login process:

    add_action( 'wp_authenticate', '_catch_empty_user', 1, 2 );
    
    function _catch_empty_user( $username, $pwd ) {
      if ( empty( $username ) ) {
        wp_safe_redirect( $redirect_to_whereever_you_want );
        exit();
      }
    }