This is a plugin of WordPress, providing JSON data to mobile APPs. Here’s the scenarios that you could use this plugin: you want to develop a mobile app or app on mac, and the app is to show the list of your blogs(in category, ta g, or keywords), after the app user click one item in the blog list, you would like to show him the detail page of the item, but the logos/banners/sidebar of blog is suitable only for a desktop other than a mobil e device or you want to do something different. In the case here, WP APP JSON maybe could help.

Source: https://github.com/zxial/code-snippets/tree/master/wp-app-json

Release: https://github.com/zxial/code-snippets/releases

Open Issues (feature request or bugs)


My first plugin of WordPress. Any comments, requirements, contribution will help.

Documents of WP-APP-JSON

In version 1.0 of WP APP JSON, 2 methods are provided,gl and dt.

Method gl will retrieve posts from the plugin, search results of keywords.

You need to call gl from the URL

  • YOURSECRECTS is the string you set in the configuration.
  • gl will Get List of Posts.
  • p which page of the results. By default, p=0 the method will return the first page of search result.

When gl is called, the following JSON will be returned as example.

{"msg":"1","0":{"ID":238,"title":"title of Post 0","excerpt":"excerpt of post 0...","thumb":"http://www.diaoyuqu.cn/wp-content/uploads/2013/12/17-150x150.jpg"},"1":{"ID":238,"title":"title of Post 1","excerpt":"excerpt of post 1...","thumb":"http://www.diaoyuqu.cn/wp-content/uploads/2013/12/17-150x150.jpg"},... }

Method dt will retrieve specified post from the plugin, by Post ID.

You need to call dt from the URL

  • YOURSECRECTS is the string you set in the configuration.
  • dt will get DeTail of specified post
  • pid is the Post ID you wanted, you can get the Post ID in method gl

NOTE: if you want to change the style in detail page, you need to modify the style.css file.



This plugin is under GPL v2 or later Licence.

Author: Zxial. Code at github. Download @ WP. Project Page: https://zxial.me/projects/wp_app_json/

%d 博主赞过: