Support » Plugin: Events Manager » JSON-API with Events Manager – querying for events

  • Resolved Daedalon

    (@daedalon)


    We’re creating a mobile application that lets users access the data stored in the site by Events Manager. This also requires us to do a JSON interface. With the following code in my custom JSON-API controller I’m able to display the events that were added recently:

    public function get_recent_events() {
    	global $json_api;
    	// See also: http://codex.wordpress.org/Template_Tags/query_posts
    	$posts = $json_api->introspector->get_posts(array(
    		'post_type' => 'event'
    	));
    	return $this->posts_result($posts);
    }

    The next step is to be able to limit the query to display only events which have a start date within the next 7 days. JSON-API’s controllers can use all WordPress’ usual methods of accessing data in custom tables, but I’m not yet familiar with them.

    What’s the best way to query the IDs of all the events that start within the next 7 days?

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘JSON-API with Events Manager – querying for events’ is closed to new replies.