title: get_posts does not return multiple post types
body: <p>I am using <strong>get_posts($query)</strong> to list posts in my WordPress plugin.</p>
  
  <p>If I use it like this: </p>
  
  <pre><code>$query['post_type'] = array('post', 'attachment');
  </code></pre>
  
  <p>Then it will not return 'attachment' types, only posts. They will be returned only if I query for them separately, like this: </p>
  
  <pre><code>$query['post_type'] = 'attachment';
  </code></pre>
  
  <p>I am using WordPress 4.9.6.</p>
  
  <p>What am I missing here?</p>
  
  <p>Thank you.</p>