JSON API - Version 0.7.3

Version Description

(2010-01-15): = * Added a count request parameter to control the number of posts returned

Download this release

Release Info

Developer dphiffer
Plugin Icon wp plugin JSON API
Version 0.7.3
Comparing to
See all releases

Code changes from version 0.7.2 to 0.7.3

json-api.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: JSON API
4
  Plugin URI: http://wordpress.org/extend/plugins/json-api/
5
  Description: A RESTful API for WordPress
6
- Version: 0.7.2
7
  Author: Dan Phiffer
8
  Author URI: http://phiffer.org/
9
  */
3
  Plugin Name: JSON API
4
  Plugin URI: http://wordpress.org/extend/plugins/json-api/
5
  Description: A RESTful API for WordPress
6
+ Version: 0.7.3
7
  Author: Dan Phiffer
8
  Author URI: http://phiffer.org/
9
  */
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: dphiffer
3
  Tags: json, api, ajax, cms, admin, integration, moma
4
  Requires at least: 2.8
5
- Tested up to: 2.8
6
- Stable tag: 0.7.2
7
 
8
  A RESTful API for WordPress
9
 
@@ -132,6 +132,7 @@ These arguments are available to modify all introspection methods:
132
  * `exclude` - Specifies which post data fields to exclude. Expects a comma-separated list of post fields.
133
  * `custom_fields` - Includes values from posts' Custom Fields. Expects a comma-separated list of custom field keys.
134
  * `author_meta` - Includes additional author metadata. Should be a comma-separated list of metadata fields.
 
135
 
136
  __About `include`/`exclude` arguments__
137
  By default you get all values included with each post object. Specify a list of `include` values will cause the post object to filter out the values absent from the list. Specifying `exclude` causes post objects to include all values except the fields you list. For example, the query `exclude=comments` includes everything *except* the comments.
@@ -558,6 +559,9 @@ Submits a comment to a WordPress post.
558
 
559
  == Changelog ==
560
 
 
 
 
561
  = 0.7.2 (2010-01-14): =
562
  * Removed the version number from the description text
563
 
2
  Contributors: dphiffer
3
  Tags: json, api, ajax, cms, admin, integration, moma
4
  Requires at least: 2.8
5
+ Tested up to: 2.9
6
+ Stable tag: 0.7.3
7
 
8
  A RESTful API for WordPress
9
 
132
  * `exclude` - Specifies which post data fields to exclude. Expects a comma-separated list of post fields.
133
  * `custom_fields` - Includes values from posts' Custom Fields. Expects a comma-separated list of custom field keys.
134
  * `author_meta` - Includes additional author metadata. Should be a comma-separated list of metadata fields.
135
+ * `count` - Controls the number of posts to include (defaults to the number specified by WordPress)
136
 
137
  __About `include`/`exclude` arguments__
138
  By default you get all values included with each post object. Specify a list of `include` values will cause the post object to filter out the values absent from the list. Specifying `exclude` causes post objects to include all values except the fields you list. For example, the query `exclude=comments` includes everything *except* the comments.
559
 
560
  == Changelog ==
561
 
562
+ = 0.7.3 (2010-01-15): =
563
+ * Added a `count` request parameter to control the number of posts returned
564
+
565
  = 0.7.2 (2010-01-14): =
566
  * Removed the version number from the description text
567
 
singletons/introspector.php CHANGED
@@ -165,6 +165,10 @@ class JSON_API_Introspector {
165
  $amp = empty($query) ? '' : '&';
166
  $query .= "{$amp}paged=" . get_query_var('page');
167
  }
 
 
 
 
168
  if (!empty($query)) {
169
  query_posts($query);
170
  }
165
  $amp = empty($query) ? '' : '&';
166
  $query .= "{$amp}paged=" . get_query_var('page');
167
  }
168
+ if (get_query_var('count')) {
169
+ $amp = empty($query) ? '' : '&';
170
+ $query .= "{$amp}posts_per_page=" . get_query_var('count');
171
+ }
172
  if (!empty($query)) {
173
  query_posts($query);
174
  }
singletons/query.php CHANGED
@@ -23,6 +23,7 @@ class JSON_API_Query {
23
  'dev', // Triggers a developer-friendly print_r() output
24
  'redirect', // Triggers a redirect response to the specified URL
25
  'page', // Returns a specific page of results
 
26
  'post_id', // Used by the get_post API method
27
  'post_slug', // Used by the get_post API method
28
  'page_id', // Used by the get_page API method
23
  'dev', // Triggers a developer-friendly print_r() output
24
  'redirect', // Triggers a redirect response to the specified URL
25
  'page', // Returns a specific page of results
26
+ 'count', // Controls the number of posts returned
27
  'post_id', // Used by the get_post API method
28
  'post_slug', // Used by the get_post API method
29
  'page_id', // Used by the get_page API method