title: Getting error in WordPress Illegal string offset
body: <pre><code>PHP Warning:  Illegal string offset 'user_login' in /home/.../wp-includes/user.php on line 83
  PHP Warning:  Illegal string offset 'user_password' in /home/.../wp-includes/user.php on line 83
  </code></pre>
  
  <p>Here the code:-</p>
  
  <pre><code>add_filter('authenticate', 'wp_authenticate_cookie', 30, 3);
  
  $user = wp_authenticate($credentials['user_login'], $credentials['user_password']);
  
  if ( is_wp_error($user) ) {
      if ( $user-&gt;get_error_codes() == array('empty_username', 'empty_password') ) {
          $user = new WP_Error('', '');
      }
  
      return $user;
  }
  </code></pre>