Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to, essentially, check whether a post exists and if it does (in published, draft or auto-draft states) return the post info. I'm finding get_post() doesn't seem to work with drafts, and get_posts() doesn't allow me to specify the specific post ID I'm looking for.

Is there a function to get post info for any publish_status by post ID?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

There is nothing in the codex that would suggest that get_post() would not work with drafts. if you experience otherwise, try get_posts() with the include or post__in parameter.

Also see the supported type and status parameters here.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.