我们在获取更新数据以进行编辑时遇到了一个问题,我找到了这段代码来获取该帖子的内容
$post->pre_post_content
而不是像这样$post->post_content
的内容pre_post_content
似乎保存的数据来自帖子的一个旧版本,而不是中更新的内容post_content
. 它还有从中剥离的短代码块,这些短代码块仍然存在于post_content
.这到底是什么?我找不到有关此的任何信息。
谢谢
我们在获取更新数据以进行编辑时遇到了一个问题,我找到了这段代码来获取该帖子的内容
$post->pre_post_content
而不是像这样$post->post_content
的内容pre_post_content
似乎保存的数据来自帖子的一个旧版本,而不是中更新的内容post_content
. 它还有从中剥离的短代码块,这些短代码块仍然存在于post_content
.这到底是什么?我找不到有关此的任何信息。
谢谢
没有这样的事。pre_post_content
是一个过滤器,允许您过滤sanitize_post_field() 对于post_content
职位领域。但是标准WP_Post
类,其中$post
通常是,没有pre_post_content
领域
如果$post
在你的网站上有这样一个字段,那么它很可能是通过插件添加的,但是一个$post->pre_post_content
什么也没找到,所以我不知道你是从哪里弄来的。
也许有人可以帮助制作自定义帖子类型的相关帖子?我受不了了。。。代码在此处:https://pastebin.com/zRVjuMBnFor example:We are in current post:ID | title | cust\\u category | cust\\u names | cust\\u settings1 | X1 | cat1,cat3 | name8 | set1,set5And we have customs posts:ID | title | cust\\u categ