Paso
Paso

Reputation: 363

How does versioning of posts work in a WordPress database

I'm developing a site ontop of a wordpress 3.0 database but is having trouble understanding the implementation of posts/draft/auto-draft/inherit/revision. I do believe that the first save (but not auto-draft?) of the post becomes the "primary" row with no parent that gets updated each time a new draft is saved, or the published post get updated. It also seem like the old "primary"-row gets copied with the status, created and parentId columns updated, but to what?

What I can't see is how post_status=revision|inherit is related to the post. Also what happends if i start to edit a published post and it gets auto-saved? What if I press draft?

I guess what the question really boils down to is if I want to insert something (eg a new auto-save of a old post) into the wp_posts table without using the wordpress codebase, which queries do I need to run?

Upvotes: 2

Views: 510

Answers (1)

Till
Till

Reputation: 1138

All revisions have post_type set to revision and post_parent pointing to ID of the active entry.

Upvotes: 1

Related Questions