WordPress“ REST API” WPBackery Page Builder和Ionic
I'm requesting Content from WordPress website built with wpbackery page builder by REST API in ionic app but i have a problem :
the Contents created by "VisualComposer" looks like this :
how can i extract the content to get the text and images only , is it possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在WordPress侧写代码,
function.php
。可以通过将以下代码添加到function.php(将另一个键添加到响应中,称为
htmlcontent
),将以下代码添加到function.php中返回API的响应中,添加另一个键例如,您 重写从API返回的原始密钥,
content
键:(注意:上面显示的代码唯一更改是传递给
regession_rest_field
的第二个参数功能)You need to write code on the WordPress side,
function.php
.For example, you can add another key to the response that returns from the call to the API by adding the following code to function.php (adding another key to the response called
htmlcontent
):Alternatively, you can rewrite the original key that comes back from api, the
content
key :(Note: The only change from the code shown above is the second parameter passed to the
register_rest_field
function)