WordPress JSON API – Support since(from) date/time

WordPress JSON API (http://wordpress.org/plugins/json-api/) is a powerful plugin that allows RESTful API for WordPress.

However, I needed specific post query such as “Get posts since 1999/01/01 11:00:00”, which JSON API did not support. After doing hours research to do so, I couldn’t find relavant answers.

Since JSON API uses WP_Query in WordPress, I thought I could use Time Parameters. (http://codex.wordpress.org/Class_Reference/WP_Query#Time_Parameters)

However, Time Parameters only support exact date/time. In the class reference, it guides to use add_filter function to add custom query like below:

In my knowledge, there was only one way to do what I wanted to do – modifying JSON API code, even if this way is so not recommended.

JSON API Version: 1.1.1

Modified file: /wp-content/plugins/json-api/singletons/introspector.php

Use: http://{your domain}/api/get_posts/?post_type=topic&since=2013-06-28%2010:01:00&orderby=date&order=ASC

NOTE: This is a bad way to accomplish what I wanted to do because it means I should modify the file every update. Should find a better way to do so.