WordPress 数据库中的帖子版本控制如何工作
我正在 WordPress 3.0 数据库上开发一个网站,但无法理解 posts/draft/auto-draft/inherit/revision 的实现。我确实相信帖子的第一次保存(但不是自动草稿?)成为“主”行,每次保存新草稿或更新已发布的帖子时,没有父行更新。旧的“主”行似乎也被复制,状态、已创建和parentId 列已更新,但又是什么呢?
我看不到 post_status=revision|inherit 与帖子有何关系。另外,如果我开始编辑已发布的帖子并且它被自动保存,会发生什么?如果我按草稿怎么办?
我想问题真正归结为如果我想在不使用 WordPress 代码库的情况下将某些内容(例如旧帖子的新自动保存)插入到 wp_posts 表中,我需要运行哪些查询?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所有修订都将
post_type
设置为revision
,并且post_parent
指向活动条目的ID
。All revisions have
post_type
set torevision
andpost_parent
pointing toID
of the active entry.