We're using WordPress to maintain data for a site that gets feed into a JSON file.
I've noticed that the post content we add to our file is not getting formatted appropriately. So when we feed it to our other website, the post content has no HTML, like paragraph tags.
I know that get_the_content runs the content through the WordPress filter to add all the correct HTML formatting. However, since we are making direct calls to the database in a custom script, we're just getting the raw post content.
What would we need to do in order to run our content through the WordPress content filter while our script is not connected to WordPress?
我们正在使用WordPress维护站点的数据,该站点将馈入
JSON
文件.我注意到我们添加到文件中的帖子内容的格式不正确.因此,当我们将其提供给其他网站时,帖子内容就没有
HTML
,如段落标签.我知道get_the_content通过WordPress过滤器运行内容,以添加所有正确的
HTML
格式.但是,由于我们是使用自定义脚本直接调用数据库,因此我们只是获取原始的帖子内容.在脚本未连接到WordPress的情况下,如何通过WordPress内容过滤器运行内容?