0

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?

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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