Version Description
Added support for custom taxonomies
Download this release
Release Info
Developer | dphiffer |
Plugin | JSON API |
Version | 1.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.1.1
- json-api.php +1 -1
- models/post.php +14 -8
- readme.txt +10 -1
- singletons/api.php +5 -1
- tests/core.get_author_index-01.phpt +1 -1
- tests/core.get_author_posts-01.phpt +1 -1
- tests/core.get_author_posts-02.phpt +1 -1
- tests/core.get_author_posts-03.phpt +1 -1
- tests/core.get_category_index-01.phpt +1 -1
- tests/core.get_category_posts-01.phpt +1 -1
- tests/core.get_date_index-01.phpt +1 -1
- tests/core.get_date_posts-01.phpt +1 -1
- tests/core.get_date_posts-02.phpt +1 -1
- tests/core.get_date_posts-03.phpt +1 -1
- tests/core.get_page-01.phpt +1 -1
- tests/core.get_page-02.phpt +1 -1
- tests/core.get_post-01.phpt +1 -1
- tests/core.get_posts-01.phpt +1 -1
- tests/core.get_posts-02.phpt +1 -1
- tests/core.get_posts-03.phpt +1 -1
- tests/core.get_recent_posts-01.phpt +1 -1
- tests/core.get_recent_posts-02.phpt +1 -1
- tests/core.get_recent_posts-03.phpt +1 -1
- tests/core.get_search_posts-01.phpt +1 -1
- tests/core.get_tag_index-01.phpt +1 -1
- tests/core.get_tag_posts-01.phpt +1 -1
- tests/core.info-01.phpt +1 -1
- tests/core.info-02.phpt +1 -1
- tests/query-01.phpt +1 -1
json-api.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: JSON API
|
4 |
Plugin URI: http://wordpress.org/plugins/json-api/
|
5 |
Description: A RESTful API for WordPress
|
6 |
-
Version: 1.1.
|
7 |
Author: Dan Phiffer
|
8 |
Author URI: http://phiffer.org/
|
9 |
*/
|
3 |
Plugin Name: JSON API
|
4 |
Plugin URI: http://wordpress.org/plugins/json-api/
|
5 |
Description: A RESTful API for WordPress
|
6 |
+
Version: 1.1.1
|
7 |
Author: Dan Phiffer
|
8 |
Author URI: http://phiffer.org/
|
9 |
*/
|
models/post.php
CHANGED
@@ -282,15 +282,21 @@ class JSON_API_Post {
|
|
282 |
'object_type' => array($type),
|
283 |
'public' => true,
|
284 |
'_builtin' => false
|
285 |
-
));
|
286 |
-
foreach ($taxonomies as $taxonomy) {
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
|
|
|
|
|
|
|
|
|
|
293 |
}
|
|
|
294 |
}
|
295 |
}
|
296 |
}
|
282 |
'object_type' => array($type),
|
283 |
'public' => true,
|
284 |
'_builtin' => false
|
285 |
+
), 'objects');
|
286 |
+
foreach ($taxonomies as $taxonomy_id => $taxonomy) {
|
287 |
+
$taxonomy_key = "taxonomy_$taxonomy_id";
|
288 |
+
if (!$json_api->include_value($taxonomy_key)) {
|
289 |
+
continue;
|
290 |
+
}
|
291 |
+
$taxonomy_class = $taxonomy->hierarchical ? 'JSON_API_Category' : 'JSON_API_Tag';
|
292 |
+
$terms = get_the_terms($this->id, $taxonomy_id);
|
293 |
+
$this->$taxonomy_key = array();
|
294 |
+
if (!empty($terms)) {
|
295 |
+
$taxonomy_terms = array();
|
296 |
+
foreach ($terms as $term) {
|
297 |
+
$taxonomy_terms[] = new $taxonomy_class($term);
|
298 |
}
|
299 |
+
$this->$taxonomy_key = $taxonomy_terms;
|
300 |
}
|
301 |
}
|
302 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: json, api, ajax, cms, admin, integration, moma
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 3.5.2
|
7 |
-
Stable tag: 1.1.
|
8 |
|
9 |
A RESTful API for WordPress
|
10 |
|
@@ -689,6 +689,7 @@ The following arguments modify how you get results back from the API. The redire
|
|
689 |
* Setting `redirect` to a URL will cause the user's browser to redirect to the specified URL with a `status` value appended to the query vars (see the *Response objects* section below for an explanation of status values).
|
690 |
* Setting `redirect_[status]` allows you to control the resulting browser redirection depending on the `status` value.
|
691 |
* Setting `dev` to a non-empty value adds whitespace for readability and responds with `text/plain`
|
|
|
692 |
* Setting `json_encode_options` will let you specify an integer bitmask to modify the behavior of [PHP's `json_encode`](http://php.net/manual/en/function.json-encode.php) (Note: this option is only recognized in PHP version 5.3+)
|
693 |
* Setting `json_unescaped_unicode` will replace unicode-escaped characters with their unescaped equivalents (e.g., `\u00e1` becomes á)
|
694 |
* Omitting all of the above arguments will result in a standard JSON response.
|
@@ -766,6 +767,7 @@ Developers familiar with WordPress may notice that many names for properties and
|
|
766 |
* `comment_status` - String (`"open"` or `"closed"`)
|
767 |
* `thumbnail` - String (only included if a post thumbnail has been specified)
|
768 |
* `custom_fields` - Object (included by setting the `custom_fields` argument to a comma-separated list of custom field names)
|
|
|
769 |
|
770 |
__Note__
|
771 |
The `thumbnail` attribute returns a URL to the image size specified by the optional `thumbnail_size` request argument. By default this will use the `thumbnail` or `post-thumbnail` sizes, depending on your version of WordPress. See [Mark Jaquith's post on the topic](http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/) for more information.
|
@@ -1034,6 +1036,10 @@ You should see the test results print out culminating in a summary:
|
|
1034 |
|
1035 |
== Changelog ==
|
1036 |
|
|
|
|
|
|
|
|
|
1037 |
= 1.1.0 (2013-06-22): =
|
1038 |
* Bugfix for `json_encode` compatibility with PHP < 5.3
|
1039 |
* Bugfix for `get_author_index` warnings in WordPress > 3.5
|
@@ -1162,6 +1168,9 @@ You should see the test results print out culminating in a summary:
|
|
1162 |
|
1163 |
== Upgrade Notice ==
|
1164 |
|
|
|
|
|
|
|
1165 |
= 1.1.0 =
|
1166 |
Minor bugfixes
|
1167 |
|
4 |
Tags: json, api, ajax, cms, admin, integration, moma
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 3.5.2
|
7 |
+
Stable tag: 1.1.1
|
8 |
|
9 |
A RESTful API for WordPress
|
10 |
|
689 |
* Setting `redirect` to a URL will cause the user's browser to redirect to the specified URL with a `status` value appended to the query vars (see the *Response objects* section below for an explanation of status values).
|
690 |
* Setting `redirect_[status]` allows you to control the resulting browser redirection depending on the `status` value.
|
691 |
* Setting `dev` to a non-empty value adds whitespace for readability and responds with `text/plain`
|
692 |
+
* Errors are suppressed unless `dev` is set to a non-empty value
|
693 |
* Setting `json_encode_options` will let you specify an integer bitmask to modify the behavior of [PHP's `json_encode`](http://php.net/manual/en/function.json-encode.php) (Note: this option is only recognized in PHP version 5.3+)
|
694 |
* Setting `json_unescaped_unicode` will replace unicode-escaped characters with their unescaped equivalents (e.g., `\u00e1` becomes á)
|
695 |
* Omitting all of the above arguments will result in a standard JSON response.
|
767 |
* `comment_status` - String (`"open"` or `"closed"`)
|
768 |
* `thumbnail` - String (only included if a post thumbnail has been specified)
|
769 |
* `custom_fields` - Object (included by setting the `custom_fields` argument to a comma-separated list of custom field names)
|
770 |
+
* `taxonomy_(taxonomy)` - Array of custom taxonomy objects (these resemble Category or Tag response objects, depending on whether the taxonomy is hierarchical)
|
771 |
|
772 |
__Note__
|
773 |
The `thumbnail` attribute returns a URL to the image size specified by the optional `thumbnail_size` request argument. By default this will use the `thumbnail` or `post-thumbnail` sizes, depending on your version of WordPress. See [Mark Jaquith's post on the topic](http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/) for more information.
|
1036 |
|
1037 |
== Changelog ==
|
1038 |
|
1039 |
+
= 1.1.1 (2013-06-23): =
|
1040 |
+
* Added support for custom taxonomies
|
1041 |
+
* Errors are now suppressed unless you include a non-empty `dev` argument
|
1042 |
+
|
1043 |
= 1.1.0 (2013-06-22): =
|
1044 |
* Bugfix for `json_encode` compatibility with PHP < 5.3
|
1045 |
* Bugfix for `get_author_index` warnings in WordPress > 3.5
|
1168 |
|
1169 |
== Upgrade Notice ==
|
1170 |
|
1171 |
+
= 1.1.1 =
|
1172 |
+
Added support for custom taxonomies
|
1173 |
+
|
1174 |
= 1.1.0 =
|
1175 |
Minor bugfixes
|
1176 |
|
singletons/api.php
CHANGED
@@ -21,6 +21,10 @@ class JSON_API {
|
|
21 |
|
22 |
if ($controller) {
|
23 |
|
|
|
|
|
|
|
|
|
24 |
if (!in_array($controller, $active_controllers)) {
|
25 |
$this->error("Unknown controller '$controller'.");
|
26 |
}
|
@@ -185,7 +189,7 @@ class JSON_API {
|
|
185 |
<?php
|
186 |
|
187 |
foreach($info['methods'] as $method) {
|
188 |
-
$url = $this->get_method_url($controller, $method
|
189 |
if ($active) {
|
190 |
echo "<code><a href=\"$url\">$method</a></code> ";
|
191 |
} else {
|
21 |
|
22 |
if ($controller) {
|
23 |
|
24 |
+
if (empty($this->query->dev)) {
|
25 |
+
error_reporting(0);
|
26 |
+
}
|
27 |
+
|
28 |
if (!in_array($controller, $active_controllers)) {
|
29 |
$this->error("Unknown controller '$controller'.");
|
30 |
}
|
189 |
<?php
|
190 |
|
191 |
foreach($info['methods'] as $method) {
|
192 |
+
$url = $this->get_method_url($controller, $method);
|
193 |
if ($active) {
|
194 |
echo "<code><a href=\"$url\">$method</a></code> ";
|
195 |
} else {
|
tests/core.get_author_index-01.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_author_index
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_author_index');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$author = $response->authors[0];
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_author_index&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$author = $response->authors[0];
|
tests/core.get_author_posts-01.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_author_posts by slug
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_author_posts&slug=themedemos');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$author = $response->author;
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_author_posts&slug=themedemos&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$author = $response->author;
|
tests/core.get_author_posts-02.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_author_posts by author_slug
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_author_posts&author_slug=themedemos&page=2');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$author = $response->author;
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_author_posts&author_slug=themedemos&page=2&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$author = $response->author;
|
tests/core.get_author_posts-03.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_author_posts by id
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_author_posts&id=2&count=20');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$author = $response->author;
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_author_posts&id=2&count=20&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$author = $response->author;
|
tests/core.get_category_index-01.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_category_index
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_category_index');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$category = $response->categories[0];
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_category_index&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$category = $response->categories[0];
|
tests/core.get_category_posts-01.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_category_posts default
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_category_posts&slug=markup');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_category_posts&slug=markup&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
tests/core.get_date_index-01.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_search_posts default
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_date_index');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$count = count($response->permalinks);
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_date_index&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$count = count($response->permalinks);
|
tests/core.get_date_posts-01.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_date_posts by day
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_date_posts&date=2013-01');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_date_posts&date=2013-01&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
tests/core.get_date_posts-02.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_date_posts by month
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_date_posts&date=2013-01');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_date_posts&date=2013-01&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
tests/core.get_date_posts-03.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_date_posts by year
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_date_posts&date=2012');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_date_posts&date=2012&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
tests/core.get_page-01.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_page default
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_page&slug=about');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_page&slug=about&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
|
tests/core.get_page-02.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_page children argument
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_page&slug=level-1&children=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$page = $response->page;
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_page&slug=level-1&children=1&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$page = $response->page;
|
tests/core.get_post-01.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_post default
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_post&slug=markup-html-tags-and-formatting');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_post&slug=markup-html-tags-and-formatting&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
|
tests/core.get_posts-01.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_posts default
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_posts');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_posts&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
tests/core.get_posts-02.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_posts by meta key
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_posts&meta_key=enclosure');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_posts&meta_key=enclosure&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
tests/core.get_posts-03.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_posts by meta value
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_posts&meta_key=_wp_old_slug&meta_value=excerpt');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_posts&meta_key=_wp_old_slug&meta_value=excerpt&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
tests/core.get_recent_posts-01.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_recent_posts default
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_recent_posts');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_recent_posts&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
tests/core.get_recent_posts-02.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_recent_posts count argument
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_recent_posts&count=3');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[3];
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_recent_posts&count=3&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[3];
|
tests/core.get_recent_posts-03.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_recent_posts page argument
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_recent_posts&page=2');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_recent_posts&page=2&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
tests/core.get_search_posts-01.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_search_posts default
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_search_results&search=foolish');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_search_results&search=foolish&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
tests/core.get_tag_index-01.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_tag_index
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_tag_index');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_tag_index&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
|
tests/core.get_tag_posts-01.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_tag_posts default
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.get_tag_posts&slug=css');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.get_tag_posts&slug=css&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$post = $response->posts[0];
|
tests/core.info-01.phpt
CHANGED
@@ -5,7 +5,7 @@ core.info default
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.info');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.info&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
|
tests/core.info-02.phpt
CHANGED
@@ -5,7 +5,7 @@ core.info controller detail
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/?json=core.info&controller=core');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/?json=core.info&controller=core&dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
|
tests/query-01.phpt
CHANGED
@@ -5,7 +5,7 @@ core.get_author_index with user-friendly URLs
|
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
-
$http->get('http://wordpress.test/api/core/get_author_index');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$author = $response->authors[0];
|
5 |
|
6 |
require_once 'HTTP/Client.php';
|
7 |
$http = new HTTP_Client();
|
8 |
+
$http->get('http://wordpress.test/api/core/get_author_index?dev=1');
|
9 |
$response = $http->currentResponse();
|
10 |
$response = json_decode($response['body']);
|
11 |
$author = $response->authors[0];
|