Opened 13 years ago
Closed 9 years ago
#20105 closed defect (bug) (worksforme)
When inserting a draft post with wp_insert_post you can't query it on name
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | |
Focuses: | Cc: |
Description
When creating a draft post with wp_insert_post you can't query it with get_post.
In my case I used the argument: name. That is the problem. Not using it will find the post.
I'm not sure if this is an expected result. I would say no.
Change History (5)
Note: See
TracTickets for help on using
tickets.
Replying to markoheijnen:
I don't understand? The only arguments that
get_post()
accepts are either apost_ID
or a post object. You can't use it to fetch a post based on slug etc.