WP插件JSON API

2017-02-12  本文已影响89人  jlnbda3488375

info get_recent_posts get_posts get_post get_page get_date_posts get_category_posts get_tag_posts get_author_posts get_search_results get_date_index get_category_index get_tag_index get_author_index get_page_index get_nonce

info

Returns information about JSON API.

    Response
    {
      "status": "ok",
      "json_api_version": "1.0",
      "controllers": [
        "core"
      ]
    }

get_recent_posts

Returns an array of recent posts.
可选:


get_posts


get_post

Returns a single post object.
必须(One of the following is required):


get_page

Returns a single page object.
必须(One of the following is required):

Optional arguments


Method: get_date_posts

Returns an array of posts/pages in a specific date archive (by day, month, or year).

One of the following is required

Optional arguments


Method: get_category_posts


Method: get_tag_posts


Method: get_author_posts


Method: get_search_results

Returns an array of posts/pages in response to a search query.

One of the following is required

Optional arguments


Method: get_date_index

Returns both an array of date page permalinks and a tree structure representation of the archive.

    Response
    {
      "status": "ok",
      "permalinks": [
        "...",
        "...",
        "..."
      ],
      "tree": {
        "2009": {
          "09": 17,
          "10": 20,
          "11": 7
        }
      }

Note: the tree is arranged by response.tree.[year].[month].[number of posts]


Method: get_category_index


Method: get_tag_index


Method: get_author_index


Method: get_page_index


Method: get_nonce

Returns a WordPress nonce value, required to call some data manipulation methods.


相关参考资料:

  1. JSON API强大的WordPress做API接口插件:http://blog.csdn.net/su_tianbiao/article/details/50622671
上一篇 下一篇

猜你喜欢

热点阅读