简体   繁体   English

将WordPress阅读为JSON的最佳方法

[英]Best way to Read WordPress as JSON

I attend to create an android version of my WordPress blog. 我参加了创建WordPress博客的android版本的工作。 So, i do some google search and Stackoverflow search to find the best way to do this works: 所以,我做了一些谷歌搜索和Stackoverflow搜索,以找到最好的方法来做到这一点:

  1. find the count of the post 查找帖子的数量
  2. category's names. 类别的名称。
  3. reed posts, page by page (or a number like read 10 post for every request) 芦苇帖子,一页一​​页(或一个数字,例如每个请求阅读10个帖子)
  4. reed posts by they tag and act like 3. 芦苇帖子由他们标记并充当3。
  5. get the thumbnail for images. 获取图像的缩略图。
  6. find the number of comment for each post. 查找每个帖子的评论数。
  7. reed all comments. 芦苇所有评论。
  8. send comment. 发表评论。
  9. and ... 还有...

So in my research si found some plugins and because of the company who make that, i think WP REST API is more trustful than the others but there is other plugin like JSON API. 因此,在我的研究中,si发现了一些插件,并且由于制造该插件的公司,我认为WP REST API比其他插件更可信,但还有其他插件,如JSON API。 so based on my needs, what is the best choice? 所以根据我的需求,最佳选择是什么?

PS: I find out the WP REST API have a version 2, but they say, it is not good enough to being used in large app. PS:我发现WP REST API具有版本2,但是他们说,它不足以在大型应用程序中使用。 Thanks. 谢谢。

The best option is to use the WP Rest API. 最好的选择是使用WP Rest API。

https://wordpress.org/plugins/json-rest-api/ https://wordpress.org/plugins/json-rest-api/

This plugin is in the process of being rolled into WordPress core, half of which is already done as of WordPress 4.4 https://wordpress.org/news/2015/10/wordpress-4-4-beta-1/ 这个插件正在被推入WordPress核心的过程中,其中一半已经在WordPress 4.4上完成https://wordpress.org/news/2015/10/wordpress-4-4-beta-1/

Don't use the V2 API at the moment, it's still subject to change. 目前请勿使用V2 API,但仍可能会发生变化。 You can use the legacy API here http://wp-api.org . 您可以在http://wp-api.org上使用旧版API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM