How can I query for all posts with any status (published, pending etc.) for a given author ID.
<?php
$loop = new WP_Query( array(
'post_type' => 'photo',
'posts_per_page' => 12,
'orderby'=> 'menu_order',
'author' => $user->data->ID,
'post_status' => '???', //what should I put here
'paged'=>$paged
));
?>
Should I provide new as the status? I visited this (link http://codex.wordpress.org/Post_Status_Transitions) 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.
Try asking this at http://wordpress.stackexchange.com. They tend to be better about WP API questions there. I’ll take a stab myself though.
According to their docs the following values are valid. I would try
any
you can use