I am creating a front end dashboard where I need to show all the posts by the current user. So, I need to show posts in all states, mainly
trashed and the
pending. I am now using a simple query but it is returning only the published posts.
$query = array( 'post_type' => 'my-post-type', 'post_author' => $current_user->ID ); query_posts($query);
Can anyone help? What else do I need to do?
'post_status' => 'any'?
query_posts. Never use
WP_Queryfor front-end, and
get_postsfor admin queries as there is an issue with
wp_reset_postdata(see the note and ticket on this issue).