Bug: wp_insert_post returns ID number without posting
-
I’m using an external PHP script to call wp_insert_post and it is returning an ID number without actually posting to the database.
// Post and keep ID number
$returnId = wp_insert_post ( $my_post );What appears to be happening is that I’m being returned recycled ID numbers for posts that were moved into the trash. I’m actually up to post 159 (at the time of this writing) but wp_insert_post is returning IDs lower than 159. When I look in MySQL to see what’s going on, I can see old posts that are in the trash with IDs that I’m being given. I can still see the original posts that were created earlier in the day programmatically and then moved to trash.
Everything was working fine today until I moved some posts to trash and then the ID recycling began. I’m thinking ideally that WordPress should NEVER RECYCLE POST IDs and that his is possibly a critical bug with the product.
- The topic ‘Bug: wp_insert_post returns ID number without posting’ is closed to new replies.