wordpress api
Ever since I moved to a mostly-JavaScript job, I've become more and more enamored with the simplicity and usefulness of JSON. Now I want everything available in JSON format, and when I encounter a service which doesn't provide a JSON API, I have a fit. I was recently brainstorming a way to place my website into a Dojo/Dijit widget and realized that WordPress doesn't provide a native JSON method of retrieving post information. Enter the awesome JSON API plugin.
自从我从事以JavaScript为主的工作以来,我对JSON的简单性和实用性越来越着迷。 现在,我希望所有内容都可以使用JSON格式,并且当我遇到不提供JSON API的服务时, 我就很满意 。 最近,我正在集思广益,将网站放置在Dojo / Dijit小部件中,并意识到WordPress没有提供本机JSON方法来检索帖子信息。 输入很棒的JSON API插件 。
The plugin is available at the WordPress website:
该插件可在WordPress网站上找到:
http://wordpress.org/extend/plugins/json-api/
http://wordpress.org/extend/plugins/json-api/
Download and install from the WordPress Admin interface.
从WordPress管理界面下载并安装。
The plugin features three main functionality:
该插件具有三个主要功能:
Core: Basic methods for pulling standard post/category/tag/etc. data. 核心:提取标准帖子/类别/标签/等的基本方法。 数据。 Posts: Provides additional functionality with regard to posts, including post creation. 帖子:提供有关帖子的其他功能,包括帖子创建。 Respond: Provides comment and trackback submission methods. 响应:提供评论和引用提交方法。Most people will only need the "Core" method enabled. Advanced users can have a shot at post and comment management.
大多数人只需要启用“核心”方法。 高级用户可以对帖子和评论进行管理。
The plugin has a billion uses and methods, all of which are documented at the following address:
该插件有十亿个用途和方法,所有用法和方法都记录在以下地址:
http://wordpress.org/extend/plugins/json-api/other_notes/
http://wordpress.org/extend/plugins/json-api/other_notes/
A few of the more useful methods include pulling all categories...
一些更有用的方法包括拉出所有类别...
/* url ?json=get_category_index */ { "status": "ok", "count": 3, "categories": [ { ... }, { ... }, { ... } ] }//.......and retrieving all posts in a given category...
...并检索给定类别中的所有帖子...
/* url ?json=get_category_posts&slug=mootools */ { "status": "ok", "count": 10, "count_total": 79, "pages": 7, "category": { ... } "posts": [ { ... }, { ... }, ... ] }//.......or just grabbing recent posts:
...或者只是抓取最近的帖子:
/* url ?json=get_recent_posts&count=10 */ { "status": "ok", "count": 10, "count_total": 79, "pages": 7, "posts": [ { ... }, { ... }, ... ] }//....As I mentioned above, there are a dozens of parameters you can provide to the plugin to fetch JSON data.
如上文所述,您可以向插件提供许多参数来获取JSON数据。
My only concern about this plugin is that it provides a anyone with the ability to sniff out all of your posts using a JSONP library. That's not the burden of the plugin creator -- just a thought from me.
我对此插件的唯一担心是,它为任何人提供了使用JSONP库嗅探您所有帖子的功能。 这不是插件创建者的负担-只是我的一个想法。
Look forward to a sample usage post from me soon!
期待不久后收到我的样本用法帖子!
翻译自: https://davidwalsh.name/wordpress-json-plugin
wordpress api
相关资源:jdk-8u281-windows-x64.exe