title: Wordpress get posts by author id
body: <p>How can I query for all posts with any status (<strong>published, pending etc.</strong>) for a given author ID.</p>
  
  <pre><code>&lt;?php               
  $loop = new WP_Query( array(
      'post_type' =&gt; 'photo',
      'posts_per_page' =&gt; 12,
      'orderby'=&gt; 'menu_order',
      'author' =&gt; $user-&gt;data-&gt;ID,
      'post_status' =&gt; '???', //what should I put here
      'paged'=&gt;$paged
  ));
  ?&gt;
  </code></pre>
  
  <p>Should I provide new as the status? I visited this (link <a href="http://codex.wordpress.org/Post_Status_Transitions" rel="nofollow">http://codex.wordpress.org/Post_Status_Transitions</a>) and got this ['new' -  When there's no previous status]. I set the status as new and it solved my problem. But I am not sure will it make any problem in future? will it show all posts for ever? I have very little experience in WP. Please help me out.</p>