Make WordPress Core

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: markoheijnen's profile markoheijnen 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)

#1 in reply to: ↑ description @solarissmoke
13 years ago

  • Keywords reporter-feedback added; dev-feedback removed

Replying to markoheijnen:

You can't query it with get_post. In my case I used the argument: name.

I don't understand? The only arguments that get_post() accepts are either a post_ID or a post object. You can't use it to fetch a post based on slug etc.

#2 @markoheijnen
13 years ago

it should have been get_posts(). I will write a test for it so I can see if I can reproduce it again.

#3 @iseulde
12 years ago

  • Keywords close added

#4 @markoheijnen
12 years ago

  • Keywords close removed

I'm still planning to look into this.

#5 @chriscct7
9 years ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Closing per lack of reporter feedback or ability to reproduce the bug. If someone can reproduce this, feel free to reopen

Note: See TracTickets for help on using tickets.