没有 html 标签的 Wordpress Restful Api
Wordpress Restful Api without html tags
我在我的 WordPress 安装上安装了 JSON API
插件,当我输出 RESTFUL API
时,有 <p>
标签和其他 html,例如,在我的应用程序中它将:
一行会说 <p>Hello World</p>
不是 Hello world(没有 html 标签)
有谁知道为什么以及如何解决这个问题?谢谢
您可以尝试从您网站上的内容中删除过滤器 wpautop
。 -- 这是假设 "Hello World" 是内容的一部分,并且您不介意从提供内容的任何地方删除 <p>
标签。
remove_filter ('the_content', 'wpautop');
这里有一些关于 wpautop
https://codex.wordpress.org/Function_Reference/wpautop
的更多文档
我在我的 WordPress 安装上安装了 JSON API
插件,当我输出 RESTFUL API
时,有 <p>
标签和其他 html,例如,在我的应用程序中它将:
一行会说 <p>Hello World</p>
不是 Hello world(没有 html 标签)
有谁知道为什么以及如何解决这个问题?谢谢
您可以尝试从您网站上的内容中删除过滤器 wpautop
。 -- 这是假设 "Hello World" 是内容的一部分,并且您不介意从提供内容的任何地方删除 <p>
标签。
remove_filter ('the_content', 'wpautop');
这里有一些关于 wpautop
https://codex.wordpress.org/Function_Reference/wpautop