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 11 Answer
Reset to default 1There'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
评论列表(0条)