What is $post->pre_post_content exactly?

We have an issue with getting updated data for editing from one of our posts in our site and i found this piece of code

We have an issue with getting updated data for editing from one of our posts in our site and i found this piece of code to get the content of the post

$post->pre_post_content

instead of something like

$post->post_content

the content of pre_post_content seems to be holding data from one of the older revisions of the post instead of the more updated content in post_content. It also has shortcode blocks stripped from it which is still present in post_content.

What is this exactly? I couldn't find any info about this.

thanks

We have an issue with getting updated data for editing from one of our posts in our site and i found this piece of code to get the content of the post

$post->pre_post_content

instead of something like

$post->post_content

the content of pre_post_content seems to be holding data from one of the older revisions of the post instead of the more updated content in post_content. It also has shortcode blocks stripped from it which is still present in post_content.

What is this exactly? I couldn't find any info about this.

thanks

Share Improve this question edited Dec 16, 2019 at 13:53 Chetan Vaghela 2,4084 gold badges10 silver badges16 bronze badges asked Dec 16, 2019 at 10:20 DogfishDogfish 1
Add a comment  | 

1 Answer 1

Reset to default 1

There's no such thing. pre_post_content is a filter that allows you to filter the result of sanitize_post_field() for the post_content field of posts. But the standard WP_Post class, which $post usually is, does not have a pre_post_content field.

If $post on your site has such a field, then it's likely being added by a plugin, but a web search of $post->pre_post_content turned up nothing, so I'm not sure where you got it from.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744900010a4599920.html

相关推荐

  • What is $post->pre_post_content exactly?

    We have an issue with getting updated data for editing from one of our posts in our site and i found this piece of code

    1天前
    90

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信