My first plugin of WordPress. Any comments, requirements, contribution will help.
This plugin provides 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, tag, 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 mobile device or you want to do something different. In the case here, wp_app_json mayble could 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
http://YOUR.WORDPRESS.DOMAIN/?YOURSECRECTS&gl&k=KEYWORDS&p=PAGENO
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
http://YOUR.WORDPRESS.DOMAIN/?YOURSECRECTS&dt&pid=xxx
YOURSECRECTS
is the string you set in the configuration.dt
will get DeTail of specified postpid
is the Post ID you wanted, you can get the Post ID in methodgl
NOTE: if you want to change the style in detail page, you need to modify the style.css file.
EXAMPLE
- Method gl: https://zxial.me/?appjson&gl&k=plugin&p=0
- Method dt: https://zxial.me/?appjson&dt&pid=107
About WP-APP-JSON
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/