Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6936439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:14:02+00:00 2026-05-27T12:14:02+00:00

How can I query for all posts with any status ( published, pending etc.

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:14:03+00:00Added an answer on May 27, 2026 at 12:14 pm

    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

    'publish' - a published post or page.
    'pending' - post is pending review.
    'draft' - a post in draft status.
    'auto-draft' - a newly created post, with no content.
    'future' - a post to publish in the future.
    'private' - not visible to users who are not logged in.
    'inherit' - a revision. see get_children.
    'trash' - post is in trashbin (available with Version 2.9).
    'any' - retrieves any status except those from post types with 'exclude_from_search' set to true.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Iam using windows forms. How can I query all child controls of a Form
I can query the AD and find all the IIS sites and their virtual
What query can return the names of all the stored procedures in a SQL
I want DBSession.query(Article).group_by(Article.created.month).all() But this query can't using How do I do this using
I can outputting all of my posts in a custom post type called Featured
DocumentsController#common_query can handle multiple different request styles. i.e. all docs in batch 4 or
Using sc command we can query, start , stop windows services. For ex: sc
In CAML I can query SharePoint Listitems using the Contains-element, but there is no
What are some ways that I can query the local machine's specifications (a range
Is there an online reference manual I can query which contains details of LoadRunner

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.